Fix hangup when launching from scripts.