Fixed bugs in rotationAngle