     before = clone @inports[publicPort].metadata
     @inports[publicPort].metadata = {} unless @inports[publicPort].metadata
     for item, val of metadata
-      @inports[publicPort].metadata[item] = val
+      if val?
+        @inports[publicPort].metadata[item] = val
+      else
+        delete @inports[publicPort].metadata[item]
     @emit 'changeInport', publicPort, @inports[publicPort], before
     @checkTransactionEnd()
 

    node.metadata = {} unless node.metadata

    for item, val of metadata
      node.metadata[item] = val

    @emit 'changeNode', node, before
    @checkTransactionEnd()

    before = clone @outports[publicPort].metadata
    @outports[publicPort].metadata = {} unless @outports[publicPort].metadata
    for item, val of metadata
      if val?
        @outports[publicPort].metadata[item] = val
      else
        delete @outports[publicPort].metadata[item]
    @emit 'changeOutport', publicPort, @outports[publicPort], before
    @checkTransactionEnd()

