Fixing bug where spurious paragraphs are emitted.
Misc tweakages