added an exception when trying to render a template when no loader has been set (closes #975)