Fix potential emulator freeze after an exception has occured