Fixed some compile errors
Fixed compilation errors caused by refactoring