       if parameter.length
         length = parameter.length
       else if parameter.value?
-        length = parameter.value.length
+        length = parameter.value.toString().length
       else
         length = @.maximumLength
 

      # ParamLenData
      if parameter.value?
        buffer.writeUInt8(8)
        buffer.writeDoubleLE(parameter.value)
      else
        buffer.writeUInt8(0)
  0x7A:

      if parameter.value?
        if length <= @maximumLength
          buffer.writeUInt16LE(length)
          buffer.writeString(parameter.value.toString(), 'ucs2')
        else
          # Length of all chunks.
          buffer.writeUInt64LE(length)
          # One chunk.
          buffer.writeUInt32LE(length)
          buffer.writeString(parameter.value.toString(), 'ucs2')
          # PLP_TERMINATOR (no more chunks).
          buffer.writeUInt32LE(0)
      else
