Bugfixes to pipeline scripts