                 for conf in badConfigurations
                     configurations.should.not.include conf
 
-        ], done
+        ], (err) ->
+            # Wait a second before removing listeners for unwanted messages
+            setTimeout ->
+                server.removeAllListeners "got-message-picard@enterprise.sf/abc"
+                server.removeAllListeners "got-message-picard@enterprise.sf/def"
+                done err
+            , 1000
+
 
     it.skip "must fail when there are too many results", (done) ->
    server = new TestServer()

    it "must replay PubSub events to the sender", (done) ->
        mam_begin = new Date().toISOString() #TODO: timezone?

        async.series [(cb) ->


            server.doTest iq, "got-iq-mam-B-1", cb, (iq) ->
                iqReceived = true
                server.removeAllListeners "got-message-picard@enterprise.sf/abc"
                server.once "got-message-picard@enterprise.sf/abc", (msg) ->
                    throw new Error("message after result iq")
                iq.attrs.should.have.property "type", "result"

