More matrix operations and tests.