Add checkpointing.