Hotfixing several errors (template.php).