Fix bugs in ontologies and multi_thread_recommend