Fixes errors created during refactoring