Added correction for single-level bad nesting.

It still produces invalid markup when multiple
sets of tags are crossed; the fix for that
isn’t too horrible, though.