Fixed ret
changed from isnormal to isfinite, the prev ignored zero