Remove unnecessary emit and minor fix.