Fix _makeTemplateObjectGetter and add tests

Mainly fixes the case of the repetition where the template objects
for a label was an empty array instead of an array of repeated
components.