Compile fixes for OSX