Changed the matrix tests to be more robust to changes in the code