fix onElemSetMod bug (issue 340)
add test for onElemSetMod bugfix (issue 340)
Merge pull request #341 from aristov/issues/340@v1

fix onElemSetMod bug (issue 340)