Fixed compilation errors on Mac 10.8