Improved error handling if a template is found that doesn't contain a
definition