Fixed access denied errors in OSX