I looked at the examples in the cookbook and noticed that almost all (or maybe all) are main lines. When I took my code outside the function the problem was gone. Could it be that a function somehow ...