     @checkTransactionEnd()
 
   setOutportMetadata: (publicPort, metadata) ->
+    publicPort = publicPort.toLowerCase()
     return unless @outports[publicPort]
 
     @checkTransactionStart()

  addEdgeIndex: (outNode, outPort, outIndex, inNode, inPort, inIndex, metadata = {}) ->
    return unless @getNode outNode
    return unless @getNode inNode
    inIndex = undefined if inIndex is null
    outIndex = undefined if outIndex is null
    metadata = {} unless metadata

  # Removing a connection will emit the `removeEdge` event.
  removeEdge: (node, port, node2, port2) ->
    @checkTransactionStart()
    port = port.toLowerCase()
    port2 = port2.toLowerCase()
    toRemove = []
    toKeep = []
    if node2 and port2
