Compile fixes for Mac OS X