Prevent toHSL from generating NaN.