Fix a bug introduced when making the g1/g2 matrix.