Refactoring.
Fix bugs.