Fixed some memory leak in apply_basic_axioms