Fix the discriminant range fitting logic