Modified test for new TreeGraph structure, bugfixes