[fix] Correctly initialize the EventEmitters to prevent memory leaks.