Fixed some bugs in the rotation (See #14)