The problem was that in the for loop that iterates the ecostress examples, a variable with the same name as an outer scope variable was used. This lead to weird interference, as in the loop also the outer scope variable was queried, but its value was already changed from previous loop iteration.. Now everything is copied, so that such an issue cannot occur anymore and the outer scope data remains untouched.