Fix bug in PHPTemplateService, and catching error when file not exist