Fix bugs in copy-struct-as
Fix parse-object and test-references.