fixed tests and broken event emitter