Added a check to make sure that .style exists before trying to access it (Bug #2105).