Fixed small issues when template is not found