Fixes for OSX build.