template.php: bug #1 pass

Fix bug #1