Permissions fix with hooks on Mac/Linux