Fix bug with empty dates