Corrected for stale last link in LIFO enumeration.
Refactored stale link correction to helper method,

in the hope that it makes it easier to understand what the code does
without comments.