Matrix: New unit tests, bug fix.