diff --git a/include/hpp/manipulation/path-planner/states-path-finder.hh b/include/hpp/manipulation/path-planner/states-path-finder.hh
index 5184e0cabe6c4162cfffec172d6ba03eac93f2a9..0e5a772778f988edcdb7fdfd3a57c2b74032e9ac 100644
--- a/include/hpp/manipulation/path-planner/states-path-finder.hh
+++ b/include/hpp/manipulation/path-planner/states-path-finder.hh
@@ -20,7 +20,6 @@
 #ifndef HPP_MANIPULATION_PATH_PLANNER_STATES_PATH_FINDER_HH
 #define HPP_MANIPULATION_PATH_PLANNER_STATES_PATH_FINDER_HH
 
-#include <unordered_map>
 #include <hpp/core/config-projector.hh>
 #include <hpp/core/config-validations.hh>
 #include <hpp/core/fwd.hh>
diff --git a/src/path-planner/states-path-finder.cc b/src/path-planner/states-path-finder.cc
index 43021f3d3391ea376cf29b64c1e24b97ccb5e3fe..a122653eb8c0cfd8be82af233193a8f3d494d813 100644
--- a/src/path-planner/states-path-finder.cc
+++ b/src/path-planner/states-path-finder.cc
@@ -17,6 +17,7 @@
 // received a copy of the GNU Lesser General Public License along with
 // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>.
 
+#include <algorithm>
 #include <hpp/constraints/affine-function.hh>
 #include <hpp/constraints/explicit.hh>
 #include <hpp/constraints/locked-joint.hh>
@@ -43,11 +44,10 @@
 #include <hpp/util/debug.hh>
 #include <hpp/util/exception-factory.hh>
 #include <hpp/util/timer.hh>
-#include <pinocchio/fwd.hpp>
-#include <pinocchio/multibody/model.hpp>
-#include <algorithm>
 #include <iomanip>
 #include <map>
+#include <pinocchio/fwd.hpp>
+#include <pinocchio/multibody/model.hpp>
 #include <typeinfo>
 #include <vector>
 
@@ -1279,7 +1279,7 @@ bool StatesPathFinder::saveIncompatibleRHS(ConstraintMap_t& pairMap,
       // indices of their respective constraints
       exploreJOC = [&](core::JointConstPtr_t j, jointOfConstraint current,
                        int initial) {
-        int constraint_index = std::get<1>(current);
+        size_t constraint_index = std::get<1>(current);
         visited[constraint_index]++;
         core::JointConstPtr_t current_joint = std::get<0>(current);
         auto iconstraint = constraints_[constraint_index];
@@ -1287,14 +1287,14 @@ bool StatesPathFinder::saveIncompatibleRHS(ConstraintMap_t& pairMap,
         auto id_cj = core::RelativeMotion::idx(current_joint);
 
         for (auto& joc : JOCs) {
-          int ci = std::get<1>(joc);
+          size_t ci = std::get<1>(joc);
           core::JointConstPtr_t ji = std::get<0>(joc);
           auto id_ji = core::RelativeMotion::idx(ji);
           if (m(id_cj, id_ji) ==
               core::RelativeMotion::RelativeMotionType::Unconstrained)
             continue;
           if (equalJoints(ji, j))
-            return std::vector<int>{initial, ci};
+            return std::vector<int>{initial, (int)ci};
           else if (visited[ci] < 2) {
             return exploreJOC(j, joc, initial);
           }
@@ -1303,10 +1303,10 @@ bool StatesPathFinder::saveIncompatibleRHS(ConstraintMap_t& pairMap,
       };
 
       // get the indices of the constraints associated to the two joints
-      auto getIndices = [&] -> std::vector<int> {
+      auto getIndices = [&]() -> std::vector<int> {
         for (auto& joc : constraints_j1) {
           visited[std::get<1>(joc)] = 1;
-          auto indices = exploreJOC(j2, joc, std::get<1>(joc));
+          auto indices = exploreJOC(j2, joc, (int)std::get<1>(joc));
           if (indices[0] >= 0 || indices[1] >= 0) return indices;
         }
         return std::vector<int>{-1, -1};