Fixes date handling