Fixed error with undefined index in template.php