Improved checkpoints implementation. #168