Small improvements to build scripts on osx