Fix wait_for_emulator mode