Add test coverage for Matrix