be more efficient on empty strings for templates.