set.lua: fix broken elems iterator (issue #10)