Fix for issue #215

Using variable "iter" instead of undefined variable "i".