Remember local copy of item var, to pass it to lambda expression. Fixes #1749.