Fixed handling of external roles.