diff --git a/bindings/pyroot_experimental/PyROOT/src/TTreePyz.cxx b/bindings/pyroot_experimental/PyROOT/src/TTreePyz.cxx
index 6ff6ca47e213478999e9c4bb320237495c68e258..4e58b5f44de72a763fa2ccc99635a63a9bb9daa0 100644
--- a/bindings/pyroot_experimental/PyROOT/src/TTreePyz.cxx
+++ b/bindings/pyroot_experimental/PyROOT/src/TTreePyz.cxx
@@ -314,8 +314,9 @@ PyObject *TryBranchPtrToPtrOverloads(int argc, PyObject *args)
                            &PyInt_Type, &bufsize,
                            &PyInt_Type, &splitlevel)) {
          bIsMatch = true;
-      } else
+      } else {
          PyErr_Clear();
+      }
    }
 
    if (bIsMatch) {
@@ -339,8 +340,9 @@ PyObject *TryBranchPtrToPtrOverloads(int argc, PyObject *args)
             klName = GetClass((CPPInstance *)address)->GetName();
             argc += 1;
          }
-      } else
+      } else {
          Utility::GetBuffer(address, '*', 1, buf, false);
+      }
 
       if (buf && !klName.empty()) {
          TBranch *branch = 0;