Fixed a minor bug with the rotation code.