Fix OSX compile errors/warnings