Fixed bug in previous checkpointing fix.

The previous code would pick the smaller of iterations or
checkpoint iterations as the desired simulation length. This
breaks if no checkpoints are defined at all and the value
of checkpoint iterations is thus 0. This has been fixed.