diff --git a/pystencils/boundaries/boundaryhandling.py b/pystencils/boundaries/boundaryhandling.py
index 88dabad0ab2c5daccecad6ef39699f5da9ca8f94..077b1cd500037ce55508a43471a9a6d077d6a94f 100644
--- a/pystencils/boundaries/boundaryhandling.py
+++ b/pystencils/boundaries/boundaryhandling.py
@@ -444,7 +444,6 @@ class BoundaryOffsetInfo(CustomCodeNode):
 
 def create_boundary_kernel(field, index_field, stencil, boundary_functor, target='cpu', **kernel_creation_args):
     elements = [BoundaryOffsetInfo(stencil)]
-    index_arr_dtype = index_field.dtype.numpy_dtype
     dir_symbol = TypedSymbol("dir", np.int64)
     elements += [Assignment(dir_symbol, index_field[0]('dir'))]
     elements += boundary_functor(field, direction_symbol=dir_symbol, index_field=index_field)
diff --git a/pystencils/cpu/kernelcreation.py b/pystencils/cpu/kernelcreation.py
index d5966de4c41d32be6830c37128dab14dbe52b151..4de8065e62352142698b24225b9b85f3c4705e66 100644
--- a/pystencils/cpu/kernelcreation.py
+++ b/pystencils/cpu/kernelcreation.py
@@ -7,7 +7,7 @@ import pystencils.astnodes as ast
 from pystencils.assignment import Assignment
 from pystencils.astnodes import Block, KernelFunction, LoopOverCoordinate, SympyAssignment
 from pystencils.cpu.cpujit import make_python_function
-from pystencils.data_types import BasicType, StructType, TypedSymbol, create_type
+from pystencils.data_types import StructType, TypedSymbol, create_type
 from pystencils.field import Field, FieldType
 from pystencils.transformations import (
     add_types, filtered_tree_iteration, get_base_buffer_index, get_optimal_loop_ordering,
diff --git a/pystencils/gpucuda/kernelcreation.py b/pystencils/gpucuda/kernelcreation.py
index dc25bf1d8bb5f89411684671807abc0ea2557980..08226e260452680b5afcc4b6c493634b778b85a7 100644
--- a/pystencils/gpucuda/kernelcreation.py
+++ b/pystencils/gpucuda/kernelcreation.py
@@ -1,7 +1,7 @@
 import numpy as np
 
 from pystencils.astnodes import Block, KernelFunction, LoopOverCoordinate, SympyAssignment
-from pystencils.data_types import BasicType, StructType, TypedSymbol
+from pystencils.data_types import StructType, TypedSymbol
 from pystencils.field import Field, FieldType
 from pystencils.gpucuda.cudajit import make_python_function
 from pystencils.gpucuda.indexing import BlockIndexing