Fix usage of emit.