Fixed compilation errors in refactoring