Small emulation bugfixes