matrix read tests and fixes