Changes for building on OSX