I think this is redundant because of the isnan check above -- can someone confirm and I'll delete this?