Bug fix in the template processing.