Fixed issue with undefined roles
More fixes with roles