Better handling of formulas typechecking