fix subtree queries to stay within the proper tree definition structure
fix table field inspection for tree rank detection