Fixed bugs in reading of checkpoints.