Fix empty dates handling.