osx build and fixing