Fixed learn_term_comparison in heuristic to handle zero comparisons
properly.