osx 10.8 build fixes