make tactic in term_to_cert a bit more robust

will have to try it on more examples to see if it still fails...