Fixed compilation errors on mac