Thanks for the hint! I changed that line but I get really strange looking plots now, for example for the initial function I get this

However, evaluating the function at given points seems to give a correct result, so I guess this solved the problem.
Thanks for the hint! I changed that line but I get really strange looking plots now, for example for the initial function I get this

However, evaluating the function at given points seems to give a correct result, so I guess this solved the problem.