Fix a few corner cases in the pipeline shell scripts.