Reinforce handling of external processes and wait()