Thanks for looking at this. Perhaps I should note that I have been using Onetopic in 'Show all sections on one page' mode. I got no titles except section 0 until I set:
echo $this->section_header($thissection, $course, true);
to
echo $this->section_header($thissection, $course, false);
But those titles appear as links. Which isn't a big problem, but, in context, doesn't make sense.