           when 'closeBracket'
             received.push "#{ip.scope} >"
             brackets.pop()
-
+        return
       wasStarted = false
       checkStart = ->
         chai.expect(wasStarted).to.equal false
         wasStarted = true
+        return
       checkEnd = ->
         chai.expect(received).to.eql expected
         chai.expect(wasStarted).to.equal true
         done()
+        return
       c.network.once 'start', checkStart
       c.network.once 'end', checkEnd
 
       c.start (err) ->
-        return done err if err
+        if err
+          done err
+          return
         in2.post new noflo.IP 'data', 'two',
           scope: 'x'
         in1.post new noflo.IP 'openBracket', 1,

    data = input.getData 'in'
    output.send data + c.nodeId
    output.done()

processGenerator = ->
  c = new noflo.Component

      c.timer = context
      c.timer.interval = setInterval ->
        output.send out: true
        return
      , 100
    if input.hasData 'stop'
      input.getData 'stop'
      unless c.timer
        output.done()
        return
      cleanUp()
      output.done()
      return
    return
  return c

describe 'Network Lifecycle', ->
  loader = null
  before (done) ->
    loader = new noflo.ComponentLoader root
    loader.listComponents (err) ->
      if err
        done err
        return
      loader.registerComponent 'process', 'Async', processAsync
      loader.registerComponent 'process', 'Sync', processSync
      loader.registerComponent 'process', 'Merge', processMerge
