LUN-782

Removed any extra trailing whitespace from template name; added tests.