Fixes for Mac OS X

Mac OS is weird.