Added tests for Matrix util methods