diff --git a/src/details.hpp b/src/details.hpp
index 5a69885b4ee8ca9adac911aef52839d96a39ed33..05f1308f47d30d422992ab3bd469346c2f8452d5 100644
--- a/src/details.hpp
+++ b/src/details.hpp
@@ -137,11 +137,12 @@ namespace eigenpy
     EigenFromPy()
     {
       bp::converter::registry::push_back
-	(&convertible,&construct,bp::type_id<MatType>());
+	(reinterpret_cast<void *(*)(_object *)>(&convertible),
+	 &construct,bp::type_id<MatType>());
     }
  
     // Determine if obj_ptr can be converted in a Eigenvec
-    static void* convertible(PyObject* obj_ptr)
+    static void* convertible(PyArrayObject* obj_ptr)
     {
       typedef typename MatType::Scalar T;
 
@@ -162,15 +163,18 @@ namespace eigenpy
 	    return 0;
 	  }
 
-      if ((PyArray_ObjectType(obj_ptr, 0)) != NumpyEquivalentType<T>::type_code)
+      if ((PyArray_ObjectType(reinterpret_cast<PyObject *>(obj_ptr), 0)) != NumpyEquivalentType<T>::type_code)
 	{
 #ifndef NDEBUG
 	  std::cerr << "The internal type as no Eigen equivalent." << std::endl;
 #endif
 	  return 0;
 	}
-
+#ifdef NPY_1_8_API_VERSION
+      if (!(PyArray_FLAGS(obj_ptr)))
+#else
       if (!(PyArray_FLAGS(obj_ptr) & NPY_ALIGNED))
+#endif
 	{
 #ifndef NDEBUG
 	  std::cerr << "NPY non-aligned matrices are not implemented." << std::endl;
diff --git a/src/fwd.hpp b/src/fwd.hpp
index 1fe3dd1d496bacaf63e2277b484443077d4c9f82..f601a7c318b6c5193cc709b0e99f17301eba0734 100644
--- a/src/fwd.hpp
+++ b/src/fwd.hpp
@@ -19,6 +19,7 @@
 
 #include <boost/python.hpp>
 #include <Eigen/Core>
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 
 namespace eigenpy
 {
diff --git a/src/map.hpp b/src/map.hpp
index 6d574949f54eff77c7482e27b7ebb549227af72a..0c0b633d48d3b181957bd165ec91ff44426f428a 100644
--- a/src/map.hpp
+++ b/src/map.hpp
@@ -60,9 +60,9 @@ namespace eigenpy
 
       const int R = (int)PyArray_DIMS(pyArray)[0];
       const int C = (int)PyArray_DIMS(pyArray)[1];
-      const int itemsize = PyArray_ITEMSIZE(pyArray);
-      const int stride1 = (int)PyArray_STRIDE(pyArray, 0) / itemsize;
-      const int stride2 = (int)PyArray_STRIDE(pyArray, 1) / itemsize;
+      const long int itemsize = PyArray_ITEMSIZE(pyArray);
+      const int stride1 = (int)PyArray_STRIDE(pyArray, 0) / (int)itemsize;
+      const int stride2 = (int)PyArray_STRIDE(pyArray, 1) / (int)itemsize;
       
       if( (MatType::RowsAtCompileTime!=R)
 	  && (MatType::RowsAtCompileTime!=Eigen::Dynamic) )
@@ -94,8 +94,8 @@ namespace eigenpy
       assert( (PyArray_DIMS(pyArray)[rowMajor]< INT_MAX)
 	      && (PyArray_STRIDE(pyArray, rowMajor) ));
       const int R = (int)PyArray_DIMS(pyArray)[rowMajor];
-      const int itemsize = PyArray_ITEMSIZE(pyArray);
-      const int stride = (int) PyArray_STRIDE(pyArray, rowMajor) / itemsize;;
+      const long int itemsize = PyArray_ITEMSIZE(pyArray);
+      const int stride = (int) PyArray_STRIDE(pyArray, rowMajor) / (int) itemsize;;
 
       if( (MatType::MaxSizeAtCompileTime!=R)
 	      && (MatType::MaxSizeAtCompileTime!=Eigen::Dynamic) )