another set of patches from Anthony Jones for copy operations cleanup and

* valid.c tree.c entities.c: another set of patches from
  Anthony Jones for copy operations cleanup and robustness
Daniel
5 files changed