Compare dates correctly.

Closes #4