fixed setRotation(0) and setRotation(2)

Some optimizations and bug fix