Fixes removeAllListeners after previous error correction in removeListener.