Fix OSX build errors