Code cleanup and bugfix in AuthRole