diff --git a/include/eigenpy/eigen-to-python.hpp b/include/eigenpy/eigen-to-python.hpp
index c254821689ee3df8a3149d2808d2d0a3071472e8..fac253712cbee8f3ee968c6080a5240c04b9bacb 100644
--- a/include/eigenpy/eigen-to-python.hpp
+++ b/include/eigenpy/eigen-to-python.hpp
@@ -25,7 +25,7 @@ namespace boost { namespace python {
     
 #ifndef BOOST_PYTHON_NO_PY_SIGNATURES
     inline PyTypeObject const*
-    get_pytype()const
+    get_pytype() const
     {
       return converter::registered_pytype<MatrixRef>::get_pytype();
     }
diff --git a/include/eigenpy/numpy-allocator.hpp b/include/eigenpy/numpy-allocator.hpp
index cb834106e9fcd15da3f88953ad3a00a05a321a6f..a7bdfdd3e287c8c3e9cbca44a59622000a3bb5cc 100644
--- a/include/eigenpy/numpy-allocator.hpp
+++ b/include/eigenpy/numpy-allocator.hpp
@@ -42,8 +42,8 @@ namespace eigenpy
       
       if(NumpyType::sharedMemory())
       {
-        PyTypeObject * py_type_ptr = &PyArray_Type;
-        PyArrayObject * pyArray = (PyArrayObject*) call_PyArray_New(py_type_ptr,
+        PyTypeObject py_type = getPyType<Scalar>();
+        PyArrayObject * pyArray = (PyArrayObject*) call_PyArray_New(&py_type,
                                                                     static_cast<int>(nd),
                                                                     shape,
                                                                     NumpyEquivalentType<Scalar>::type_code,
@@ -80,8 +80,8 @@ namespace eigenpy
       
       if(NumpyType::sharedMemory())
       {
-        PyTypeObject * py_type_ptr = &PyArray_Type;
-        PyArrayObject * pyArray = (PyArrayObject*) call_PyArray_New(py_type_ptr,
+        PyTypeObject py_type = getPyType<Scalar>();
+        PyArrayObject * pyArray = (PyArrayObject*) call_PyArray_New(&py_type,
                                                                     static_cast<int>(nd),
                                                                     shape,
                                                                     NumpyEquivalentType<Scalar>::type_code,