Fix some bug in rotate. Temp backup.
Temp backup. Fix bug in __rotate_left and __rotate_right.
Fix all bugs.