After much investigation, I'm now convinced that attached fix is the right thing, but it results in Processed region being set to '0' when the last line of the document is parsed. Investigating.