fix osx build errors