Adding debugging output to try to figure out the tree problem.