fix and test for Entity.get_roles_for_members() bug