Fix two bugs in TemplateRow

This pull request solves the two bugs mentioned in the issue #100 regarding template rows.