osx build fixes done with dan