           chai.expect(hadData).to.be.true
           done()
 
-        err.removeAllListeners()
         err.on 'data', (data) ->
           done data
 

      c = new noflo.Component
      c.inPorts.add 'form',
        datatype: 'object'
        handle: (ip) ->
          return unless ip.type is 'data'
          payload = ip.data
          # Validate form
          unless payload.name and payload.name.match /^\w{3,16}$/
            c.error noflo.helpers.CustomError 'Incorrect name',
              kind: 'form_error'
              code: 'invalid_name'
              param: 'name'
          unless payload.email and payload.email.match /^\w+@\w+\.\w+$/
            c.error noflo.helpers.CustomError 'Incorrect email',
              kind: 'form_error'
              code: 'invalid_email'
              param: 'email'
          unless payload.accept
            c.error noflo.helpers.CustomError 'Terms have to be accepted',
              kind: 'form_error'
              code: 'terms_not_accepted'
              param: 'accept'


      it 'should pass if everything is correct', (done) ->
        hadData = false
        saved.once 'data', (data) ->
          chai.expect(data).to.be.true
          hadData = true
