Fixed parser failure on page irregularities

I'm working on a project to parse all of English Wikipedia. So far, I've encountered three specific cases where the parser fails violently on unclosed tags or the like.

I've fixed a couple potential infinite loops and one off-by-one error that results in choking on an undefined property. The patches I'm submitting as candidate solutions have been tested on a sizable fraction of English Wikipedia, and seem to produce the same results as the original, except in the error cases.

The patch extended descriptions include the article the parser failed on.