Fixed a bug where NAN printed.