Add handling for nil date elements