Fix loop peristency state -- variables all reset now at loop start.