Fixed datetime comparison bug in list_all