Added new unit test and fixed matrixToString()