Fixed the bug with the dates being compered even if there are no dates
at all.