After the foreach, the cursor is already dead. The iterator's "valid()" call makes sure of that. I'll added it before merging though.