Correct invalid date exception handling.
Merge commit 'd061321a332f4173728343ed111c1ef9d6adb22c'