Safari doesn't have Number.isNaN(). Fixed.