JL: Fixes to matrix_eqn.