Fixed compilation errors on Darwin