Improved support for text content in templates.