Correct errors from refactoring