Fixed bug in setting of dates