Added some safety precautions against missing dates, in preparation for making dates optional