Added tests for matrix.