Fix a bug at checkpoint