Cleaned up run and spawn_pipe.