Work on bug #8161.  More tweaks to the templates.