Guard against infinite recursion in output templates.