Fixed a bug in the list/set factories