Added test for internal correctness of tree