diff --git a/doc/notebooks/02_tutorial_basic_kernels.ipynb b/doc/notebooks/02_tutorial_basic_kernels.ipynb
index 0ecdd13d5670116ce49716d452a2eaed2fe49580..eceb7117d1d861c9d904376082d85f0931d521f2 100644
--- a/doc/notebooks/02_tutorial_basic_kernels.ipynb
+++ b/doc/notebooks/02_tutorial_basic_kernels.ipynb
@@ -917,4 +917,4 @@
  },
  "nbformat": 4,
  "nbformat_minor": 2
-}
+}
\ No newline at end of file
diff --git a/pystencils/cpu/vectorization.py b/pystencils/cpu/vectorization.py
index f1f83612f302787cef1eb4547e8e14a29197f4c9..b3236a3c5cab7925116431ae343e20ca0fea0f1f 100644
--- a/pystencils/cpu/vectorization.py
+++ b/pystencils/cpu/vectorization.py
@@ -270,7 +270,7 @@ def insert_vector_casts(ast_node, instruction_set, default_float_type='double'):
             new_arg = visit_expr(expr.args[0], default_type)
             base_type = get_type_of_expression(expr.args[0]).base_type if type(expr.args[0]) is VectorMemoryAccess \
                 else get_type_of_expression(expr.args[0])
-            pw = sp.Piecewise((-new_arg, new_arg < cast_func(0, base_type.numpy_dtype)),
+            pw = sp.Piecewise((-new_arg, new_arg < CastFunc(0, base_type.numpy_dtype)),
                               (new_arg, True))
             return visit_expr(pw, default_type)
         elif expr.func in handled_functions or isinstance(expr, sp.Rel) or isinstance(expr, BooleanFunction):