Compile fixes for OS X