Added caching for item lookup in a tree.