Fixed bug with datetime type