Updated models/template.class.php