BUG: Avoid returning nans in lowess.

Contains #1960 plus one more fix.