Merged changes to allow checkpointing of the pipeline