     writeParameterData: (buffer, parameter) ->
       if parameter.length
         length = parameter.length
-      else if parameter.value
+      else if parameter.value?
         length = parameter.value.length
       else
         length = @.maximumLength

    writeParameterData: (buffer, parameter) ->
      if parameter.length
        length = 2 * parameter.length
      else if parameter.value
        length = 2 * parameter.value.length
      else
        length = @maximumLength

    declaration: (parameter) ->
      if parameter.length
        length = parameter.length
      else if parameter.value?
        length = parameter.value.length
      else
        length = @.maximumLength
