fixes for osx to compile