Made failMatrix a function. Extracted solidMatrix from setMatrix, so that a matrix is injected into setMatrix.