diff --git a/include/eigenpy/details.hpp b/include/eigenpy/details.hpp
index 58a8a6b2c3364f3f404767ebc52c4fe962e8f724..2fa0de5e0bd8f4d6ae6ffb058f32a730511b4f2d 100644
--- a/include/eigenpy/details.hpp
+++ b/include/eigenpy/details.hpp
@@ -275,7 +275,7 @@ namespace eigenpy
 
       PyArrayObject* pyArray;
       // Allocate Python memory
-      if( ( (((C == 1) xor (R == 1)) && !MatType::IsVectorAtCompileTime) || MatType::IsVectorAtCompileTime)
+      if( ( ((!(C == 1) != !(R == 1)) && !MatType::IsVectorAtCompileTime) || MatType::IsVectorAtCompileTime)
          && NumpyType::getType() == ARRAY_TYPE) // Handle array with a single dimension
       {
         npy_intp shape[1] = { C == 1 ? R : C };