Add #521 - second attempt

Actually, I'd put this in a separate identical loop with a comment. It makes no difference to the code, but as it is now the comment above makes no sense and it's non-obvious why we copy the value.