Modified quit methods with correct way to kill the spawned processes.