Fix chmod problem in OSX build