Fix for missing isnan on Python 2.5