Make template TypeError handling not so stupid.