Correcting some issues with treestore querying.