Fix matrix.