Fix pipes and exit