fixes to work with OSX