Fix a bug.
Refactoring.