Ensure expect scripts wait for spawned process.
Fix typo.
Reuse key if possible.
Minor optimization.