Handle the result of QueryGroups() correctly