Issue #2660022: Template.php losses the footer + Error: trying to get non-object at line 165 of template.php