bugfixes for tests
Added new unit test and fixed matrixToString()