Fixing date time related bugs