Throw exception on bad template name