fixed cloning of asset references

fixes #611
fixes #532
fixes #537
fixes #617 

Good catch. I'll update the tests and patch.