Mirror emulator memory-related bugfixes.