Improve OSX support