Bug fix for groups iterator