bugfix in Formula.simplify