more tree traversal fixes