Added tests for matrix