Improved numeric stability of matrix operations, prevents glitches in some cases