OSX build fixes