Misc fixes to doc build

The more innocous bits and pieces of #5925, no sense in waiting.