Made a few quick updates to do_advance to keep ch->top_level in check