Fix some issues on rotate.