Cleanup error handling in CopyTree