Add isnan() for score calculation.