Compile fixes for OS X 10.8