Minor bug fixes to DateTypeFunctions