osx compilation fixes