Fixed little bug in the matrix.cpp