diff --git a/python/dune/perftool/ufl/visitor.py b/python/dune/perftool/ufl/visitor.py
index de14a9f7cef0fc713a96953125ce08437038fb64..8773efff42e76ca8030e09810f143dec03e2ee21 100644
--- a/python/dune/perftool/ufl/visitor.py
+++ b/python/dune/perftool/ufl/visitor.py
@@ -272,6 +272,8 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
         return flattened_sum(tuple(self.call(op) for op in o.ufl_operands))
 
     def zero(self, o):
+        # UFL has Zeroes with shape. We ignore those indices.
+        self.indices = None
         return 0
 
     def abs(self, o):