Fix multiple calls to next.