Fixes an event emitter leak.