Added tests for sparse matrix