diff --git a/src/multibody/joint/joint-revolute-unaligned.hpp b/src/multibody/joint/joint-revolute-unaligned.hpp
index f71ab541477bf91a390d0c00b0ba965504bbe0bf..c353e4ee97f0e095b504b9e2c26b13b316d6c3ea 100644
--- a/src/multibody/joint/joint-revolute-unaligned.hpp
+++ b/src/multibody/joint/joint-revolute-unaligned.hpp
@@ -270,13 +270,13 @@ namespace se3
   inline
 #if EIGEN_VERSION_AT_LEAST(3,2,90)
   const typename Eigen::Product<
-  const typename SizeDepType<3>::ColsReturn<M6Like>::ConstType,
-  const typename ConstraintRevoluteUnalignedTpl<S2,O2>::Vector3
+  typename Eigen::internal::remove_const<typename SizeDepType<3>::ColsReturn<M6Like>::ConstType>::type,
+  typename ConstraintRevoluteUnalignedTpl<S2,O2>::Vector3
   >
 #else
   const typename Eigen::ProductReturnType<
-  const typename SizeDepType<3>::ColsReturn<M6Like>::ConstType,
-  const typename ConstraintRevoluteUnalignedTpl<S2,O2>::Vector3
+  typename Eigen::internal::remove_const<typename SizeDepType<3>::ColsReturn<M6Like>::ConstType>::type,
+  typename ConstraintRevoluteUnalignedTpl<S2,O2>::Vector3
   >::Type
 #endif
   operator*(const Eigen::MatrixBase<M6Like> & Y, const ConstraintRevoluteUnalignedTpl<S2,O2> & cru)
diff --git a/src/multibody/joint/joint-spherical-ZYX.hpp b/src/multibody/joint/joint-spherical-ZYX.hpp
index 5646fd6530cf401bc76ce2e2a36528cff12023b2..fa79b4dd6385bb9f70209e50600ff27c3ba24dbc 100644
--- a/src/multibody/joint/joint-spherical-ZYX.hpp
+++ b/src/multibody/joint/joint-spherical-ZYX.hpp
@@ -355,13 +355,13 @@ namespace se3
   template<typename Matrix6Like, typename S2, int O2>
 #if EIGEN_VERSION_AT_LEAST(3,2,90)
   const typename Eigen::Product<
-  typename SizeDepType<3>::ColsReturn<Matrix6Like>::ConstType,
-  const typename ConstraintSphericalZYXTpl<S2,O2>::Matrix3
+  typename Eigen::internal::remove_const<typename SizeDepType<3>::ColsReturn<Matrix6Like>::ConstType>::type,
+  typename ConstraintSphericalZYXTpl<S2,O2>::Matrix3
   >
 #else
   const typename Eigen::ProductReturnType<
-  typename SizeDepType<3>::ColsReturn<Matrix6Like>::ConstType,
-  const typename ConstraintSphericalZYXTpl<S2,O2>::Matrix3
+  typename Eigen::internal::remove_const<typename SizeDepType<3>::ColsReturn<Matrix6Like>::ConstType>::type,
+  typename ConstraintSphericalZYXTpl<S2,O2>::Matrix3
   >::Type
 #endif
   operator*(const Eigen::MatrixBase<Matrix6Like> & Y,
diff --git a/src/multibody/joint/joint-spherical.hpp b/src/multibody/joint/joint-spherical.hpp
index 9c27634f1826e7abd163d9a63f6e5cd01352d1e5..9c97eae5d1a64b3bb80c692f8be4d7e7f577616c 100644
--- a/src/multibody/joint/joint-spherical.hpp
+++ b/src/multibody/joint/joint-spherical.hpp
@@ -217,7 +217,7 @@ namespace se3
 
   /* [ABA] Y*S operator*/
   template<typename M6Like, typename S2, int O2>
-  inline const typename SizeDepType<3>::ColsReturn<M6Like>::ConstType
+  inline typename SizeDepType<3>::ColsReturn<M6Like>::ConstType
   operator*(const Eigen::MatrixBase<M6Like> & Y,
             const ConstraintSphericalTpl<S2,O2> &)
   {