Fixed the rotation functionality.