Corrected pipeline cleanup script + some cleaning