Fixed compilation errors

Compiles without error but not tested