Fixes
merge_treeswas altering the original treesenvelope_treeswas missing a condition where there were no leaf nodes specified.
merge_trees was altering the original treesenvelope_trees was missing a condition where there were no leaf nodes specified.