Changed how running a process and waiting for exit is handled