Fixed to stop all processes on exit (except detached processes)