Revert "Revert "Minor fix for templates""

This reverts commit 0ba95a4164904dc9a8ce910b648224a663a901ca.