Simplify tree.c somewhat