[issue #73] Fix foreach: adding elements in loop