         buffer.writeUInt8 0
     validate: (value) ->
       if not value? then return null
-      if `value == "Invalid Date"` then return new TypeError "Invalid date."
-      if value instanceof Date then return value
-      value = Date.parse value
+      if not (value instanceof Date) then value = Date.parse value
       if isNaN value then return new TypeError "Invalid date."
-      value
+      return value
   0x2A:
     type: 'DATETIME2N'
     name: 'DateTime2N'

        buffer.writeUInt8(0)
    validate: (value) ->
      if not value? then return null
      if `value == "Invalid Date"` then return new TypeError "Invalid date."
      if value instanceof Date then return value
      value = Date.parse value
      if isNaN value then return new TypeError "Invalid date."
      value
  0x3B:
    type: 'FLT4'
    name: 'Real'

        buffer.writeUInt8(0)
    validate: (value) ->
      if not value? then return null
      if not (value instanceof Date) then value = Date.parse value
      if isNaN value then return new TypeError "Invalid date."
      return value
  0x3E:
    type: 'FLT8'
    name: 'Float'
