fixes for OSX compile