Add rotation support.
Fix a bug.