various fixes for osx