diff --git a/python_binding/data/pybind_Data.cpp b/python_binding/data/pybind_Data.cpp
index b1e879d8387a71a3819ee7e0f8bbcd1e9936c146..13daf2198a7e14c4e8e54d790bb099731b9a8afa 100644
--- a/python_binding/data/pybind_Data.cpp
+++ b/python_binding/data/pybind_Data.cpp
@@ -60,6 +60,16 @@ void init_Data(py::module& m){
     bindEnum<DataType>(m, "dtype");
     bindEnum<DataFormat>(m, "dformat");
 
+    py::enum_<DataFormat>(m, "dformat")
+    .value("Default", DataFormat::Default)
+    .value("NCHW", DataFormat::NCHW)
+    .value("NHWC", DataFormat::NHWC)
+    .value("CHWN", DataFormat::CHWN)
+    .value("NCDHW", DataFormat::NCDHW)
+    .value("NDHWC", DataFormat::NDHWC)
+    .value("CDHWN", DataFormat::CDHWN)
+    ;
+
     py::class_<Data, std::shared_ptr<Data>>(m,"Data");
 
 
diff --git a/src/backend/OperatorImpl.cpp b/src/backend/OperatorImpl.cpp
index dd5c5c110154427a8af7afbf70b2c76b61e507a8..d2e68710b34f2a2e707810b276c138705c57eba0 100644
--- a/src/backend/OperatorImpl.cpp
+++ b/src/backend/OperatorImpl.cpp
@@ -128,8 +128,8 @@ Aidge::ImplSpec Aidge::OperatorImpl::getBestMatch(const ImplSpec& requiredSpecs)
             const auto qualifierPos = std::find_if(attrName.begin(), attrName.end(),
                 [](char c) { return c == ':'; });
             if (qualifierPos != attrName.end()) {
-                name = attrName.substr(0, qualifierPos - attrName.begin());
-                qualifier = attrName.substr(qualifierPos - attrName.begin() + 1);
+                name = attrName.substr(0, (qualifierPos - attrName.begin()));
+                qualifier = attrName.substr((qualifierPos - attrName.begin())+1);
             }
             const bool mandatory = (qualifier == "!");
             if (mandatory) {