Failing gracefully when templates miss essential attributes

re #365