Adding index identifiers to template repeat. Fixes #171