Added encoder emulation.