Fix OSX compile errors