Fixes for OS X