solver: Fix substitution in Expression
solver: Fix substitution in Expression

We are using the coefficient's sign, instead of checking whether a term
exists at all, to decide whether or not to update the term's
coefficient. This causes multiple columns to be leaked in the tableau of
the solver.

This commit fixes the case where a layout cannot shrink after growing to
a new size.

ebassi/emeus,ebassi/emeus,ebassi/emeus