Fixed parsing bug in percolator, where everything after the `doc` object was skipped.

Closes #4325