Fixed the return type of emit.