Fix cloning to other ASTs - dereference pointers to IDs and look up the items on the new lists