Mac osx fixes