Minor changes ported from mtorture repo.
Matriplex fitting code and corresponding test.