Fixed a bug with undefined and added test coverage:

NaN, Dates, null, undefined. Also fixes #2 by implementing it more solidly.