OSX compilation fixes