Remove duplicates from groups