Fixed problem with empty template.