Fixes for osx to compile