Fix bug in first matrix pass.