fixes for OSX building