Fixed bug in matrix solve.