Longterm fix for adding </doc> to the end of results streams.
Merge branch 'master' into develop