Fixes for OSX