Fix accuracy errors by switching to Gaussian Elimination computation for matrix rank