Added a check to make sure 0 permissions are not set