More fixes to permissions-related stuff.