Fixed issue with NaN dates