switched from isNaN to isFinite, see #131