Fix caching of ontology lookups