better error messages in loadTemplates