Implemented get_schema_tree, and use this to correctly evaluate schemas