Fixed refactoring problems.