fixes for OSX