Build fixes for OSX