       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(1)
        buffer.writeInt8(parameter.value)
      else
        buffer.writeUInt8(0)
  0x32:

      if parameter.length
        length = 2 * parameter.length
      else if parameter.value?
        length = 2 * parameter.value.toString().length
      else
        length = @maximumLength

