bugfix with the `sampling` iterate clause

Now works in more complicated iterate forms where the sampling clause
is present but not executed.

refs Programming:#310