Fix bug in tal:define/repeat handling