Fixed OSX build issues