Made changes to IsTree, added tests.