Fixed problems with all zero date that is not allowed in PostgreSQL.