Fix incorrect use of copy() on list, causing a traceback

Similar issue to  #6150, this time with tag handling.