Adding some diagnostics.
Improved output of code blocks.