Fixed a terrible mistake regarding order of permission bits