Worked around potential NaN/Inf problem in specular_d