Fixed OSX build errors