fix message iterator and checkpoint bugs