Fix bug when creating sets.