Fixed to use NAN instead of nan by default.