Fixed invalid date formatting handling
Fixes #1