Various improvements to template blocks.