Fix for #1304

I believe this fix addresses the problem outline in #1304.  Loop was
matching against nodes incorrectly in the case of more than 1 submit.