Fixed addToList bug for list data.

Calling addToList to add list data only works if the list already
has all of its elements initialized, since a copy of the list is
being made.