diff --git a/include/Containers/FOctree.hpp b/include/Containers/FOctree.hpp
index 6317a4873ed2d751970bb0d468aec5abe0ea0c3c..82a901b96f8bb76ada0ff1d475e39ca62806f1bf 100644
--- a/include/Containers/FOctree.hpp
+++ b/include/Containers/FOctree.hpp
@@ -741,7 +741,7 @@ public:
     CellClass* getCell(const MortonIndex inIndex, const int inLevel) const{
         SubOctreeTypesConst workingTree;
         workingTree.tree = this->root;
-        const MortonIndex treeSubLeafMask = ~(~0x00LL << (3 *  workingTree.tree->getSubOctreeHeight() ));
+        const MortonIndex treeSubLeafMask = ~(~0ULL << (3 *  workingTree.tree->getSubOctreeHeight() ));
 
         // Find the suboctree a the correct level
         while(inLevel >= workingTree.tree->getSubOctreeHeight() + workingTree.tree->getSubOctreePosition()) {
@@ -753,7 +753,7 @@ public:
         }
 
         // compute correct index in the array
-        const MortonIndex treeLeafMask = ~(~0x00LL << (3 *  (inLevel + 1 - workingTree.tree->getSubOctreePosition()) ));
+        const MortonIndex treeLeafMask = ~(~0ULL << (3 *  (inLevel + 1 - workingTree.tree->getSubOctreePosition()) ));
         return workingTree.tree->cellsAt(inLevel - workingTree.tree->getSubOctreePosition())[treeLeafMask & inIndex];
     }
 
@@ -820,7 +820,7 @@ public:
         SubOctreeTypesConst workingTree;
         workingTree.tree = this->root;
 
-        const MortonIndex treeMiddleMask = ~(~0x00LL << (3 *  workingTree.tree->getSubOctreeHeight() ));
+        const MortonIndex treeMiddleMask = ~(~0ULL << (3 *  workingTree.tree->getSubOctreeHeight() ));
 
         // Find the suboctree a the correct level
         while(inLevel >= workingTree.tree->getSubOctreeHeight() + workingTree.tree->getSubOctreePosition()) {
@@ -833,12 +833,12 @@ public:
 
         // Be sure there is a parent allocated
         const int levelInTree = inLevel - workingTree.tree->getSubOctreePosition();
-        if( levelInTree && !workingTree.tree->cellsAt(levelInTree - 1)[~(~0x00LL << (3 * levelInTree )) & (inIndex>>3)]){
+        if( levelInTree && !workingTree.tree->cellsAt(levelInTree - 1)[~(~0ULL << (3 * levelInTree )) & (inIndex>>3)]){
             return nullptr;
         }
 
         // compute correct index in the array and return the @ in array
-        const MortonIndex treeLeafMask = ~(~0x00LL << (3 * (levelInTree + 1 ) ));
+        const MortonIndex treeLeafMask = ~(~0ULL << (3 * (levelInTree + 1 ) ));
         return &workingTree.tree->cellsAt(levelInTree)[treeLeafMask & inIndex];
     }
 
@@ -1301,7 +1301,7 @@ public:
     ContainerClass* getLeafSrc(const MortonIndex inIndex){
         SubOctreeTypes workingTree;
         workingTree.tree = this->root;
-        const MortonIndex treeSubLeafMask = ~(~0x00LL << (3 *  workingTree.tree->getSubOctreeHeight() ));
+        const MortonIndex treeSubLeafMask = ~(~0ULL << (3 *  workingTree.tree->getSubOctreeHeight() ));
 
         // Find the suboctree a the correct level
         while(leafIndex >= workingTree.tree->getSubOctreeHeight() + workingTree.tree->getSubOctreePosition()) {
@@ -1313,7 +1313,7 @@ public:
         }
 
         // compute correct index in the array
-        const MortonIndex treeLeafMask = ~(~0x00LL << (3 *  (leafIndex + 1 - workingTree.tree->getSubOctreePosition()) ));
+        const MortonIndex treeLeafMask = ~(~0ULL << (3 *  (leafIndex + 1 - workingTree.tree->getSubOctreePosition()) ));
         return workingTree.leafTree->getLeafSrc(int(treeLeafMask & inIndex));
     }
 
diff --git a/include/Containers/FSubOctree.hpp b/include/Containers/FSubOctree.hpp
index 67df8f3322366648a8d9d2c66c2171b69fefbf43..7bfc6d0d7b019d891123ad4bb6daea604b087cd9 100644
--- a/include/Containers/FSubOctree.hpp
+++ b/include/Containers/FSubOctree.hpp
@@ -65,7 +65,7 @@ protected:
         // Remove right useless part - used by child
         const MortonIndex fullIndex = index >> (3 * (inTreeHeight - (this->subOctreeHeight + this->subOctreePosition) ) );
         // Remove left extra data part - used by parent
-        const MortonIndex treeLeafMask = ~(~0x00LL << (3 *  this->subOctreeHeight ));
+        const MortonIndex treeLeafMask = ~(~0ULL << (3 *  this->subOctreeHeight ));
         return treeLeafMask & fullIndex;
     }