Fix possible invalid memory access with checkpoints.