Fixup matrix inversion.