Major changes to template loop behaviour.