Date/Time functions bug fix