Improved computation and NaN handling for conformal factors in the flattening step.