Cleanup error handling in CopyTree
Merge branch 'file_injection' into exper