Fixed minor issues, introduced emulation reset upon DESELECT to make the emulation more stable