added recursive ontology traversal and several bug fixes