Fixes for Mac OS X