Avoiding infinite loops in the numerical decompositions when NaN values are present.