Fix bug with permissions being set to username on login