Improved osx compatibility