Fix to use emit_chain instead of emit.