Bugfixes for refactored rotate.