Fix possible duplicates when voting (old code).