fixes the crash when one of the diagonal covariance matrix is negative, also the problem with LinAlgError