Updated to autogenerate tree if tree.json missing