OSX compilation errors fixed