Fixed OS X build issues