bug #2906: create arrays for repeated template variables