Don't leak type objects when destroying the tree.