diff --git a/pystencils/boundaries/boundaryhandling.py b/pystencils/boundaries/boundaryhandling.py
index a1d23a372d1a623d8b78a5972cc7a8457fb84063..7af729ace1d95ceeba8df9c02e0e908c13aa7189 100644
--- a/pystencils/boundaries/boundaryhandling.py
+++ b/pystencils/boundaries/boundaryhandling.py
@@ -22,7 +22,7 @@ try:
 except ImportError:
     ParallelDataHandling = None
 
-DEFAULT_FLAG_TYPE = np.uint32
+DEFAULT_FLAG_TYPE = np.uint64
 
 
 class FlagInterface:
diff --git a/pystencils/boundaries/createindexlistcython.pyx b/pystencils/boundaries/createindexlistcython.pyx
index 0931fdc7fe1038a7445f4e97a65ea24074e684fe..bf8bc7e4332b9e548f671aa3b4f77a4def8719e9 100644
--- a/pystencils/boundaries/createindexlistcython.pyx
+++ b/pystencils/boundaries/createindexlistcython.pyx
@@ -19,8 +19,8 @@ ctypedef fused IntegerType:
 def create_boundary_neighbor_index_list_2d(object[IntegerType, ndim=2] flag_field,
                                            int nr_of_ghost_layers, IntegerType boundary_mask, IntegerType fluid_mask,
                                            object[int, ndim=2] stencil, int single_link):
-    cdef int xs, ys, x, y
-    cdef int dirIdx, num_directions, dx, dy
+    cdef long long xs, ys, x, y
+    cdef long long dirIdx, num_directions, dx, dy
 
     xs, ys = flag_field.shape
     boundary_index_list = []
@@ -44,8 +44,8 @@ def create_boundary_neighbor_index_list_2d(object[IntegerType, ndim=2] flag_fiel
 def create_boundary_neighbor_index_list_3d(object[IntegerType, ndim=3] flag_field,
                                            int nr_of_ghost_layers, IntegerType boundary_mask, IntegerType fluid_mask,
                                            object[int, ndim=2] stencil, int single_link):
-    cdef int xs, ys, zs, x, y, z
-    cdef int dirIdx, num_directions, dx, dy, dz
+    cdef long long xs, ys, zs, x, y, z
+    cdef long long dirIdx, num_directions, dx, dy, dz
 
     xs, ys, zs = flag_field.shape
     boundary_index_list = []
@@ -72,8 +72,8 @@ def create_boundary_neighbor_index_list_3d(object[IntegerType, ndim=3] flag_fiel
 def create_boundary_cell_index_list_2d(object[IntegerType, ndim=2] flag_field,
                                        IntegerType boundary_mask, IntegerType fluid_mask,
                                        object[int, ndim=2] stencil, int single_link):
-    cdef int xs, ys, x, y
-    cdef int dirIdx, num_directions, dx, dy
+    cdef long long xs, ys, x, y
+    cdef long long dirIdx, num_directions, dx, dy
 
     xs, ys = flag_field.shape
     boundary_index_list = []
@@ -98,8 +98,8 @@ def create_boundary_cell_index_list_2d(object[IntegerType, ndim=2] flag_field,
 def create_boundary_cell_index_list_3d(object[IntegerType, ndim=3] flag_field,
                                        IntegerType boundary_mask, IntegerType fluid_mask,
                                        object[int, ndim=2] stencil, int single_link):
-    cdef int xs, ys, zs, x, y, z
-    cdef int dirIdx, num_directions, dx, dy, dz
+    cdef long long xs, ys, zs, x, y, z
+    cdef long long dirIdx, num_directions, dx, dy, dz
 
     xs, ys, zs = flag_field.shape
     boundary_index_list = []
diff --git a/pystencils/datahandling/datahandling_interface.py b/pystencils/datahandling/datahandling_interface.py
index 0eb101815ec39788cb2b1b9e720f2628bf087edf..62251bb4fadaa87c0683b85965cd0273bd007bc2 100644
--- a/pystencils/datahandling/datahandling_interface.py
+++ b/pystencils/datahandling/datahandling_interface.py
@@ -425,7 +425,7 @@ class Block:
 
         Cell indices start at 0 at the first inner cell, lower ghost layers have negative indices
         """
-        mesh_grid_params = [offset + np.arange(width, dtype=np.int32)
+        mesh_grid_params = [offset + np.arange(width, dtype=np.int64)
                             for offset, width in zip(self.offset, self.shape)]
         return np.meshgrid(*mesh_grid_params, indexing='ij', copy=False)