Fix iterating over a linked list so we don't lose track of the first ele...

...ment

I don't know what sort of brainfart happened in my initial version