NICE! Thanks! I didn't know about the ability to scan the HTML from within Calibre. Now that i know it's there, i'll use it a lot.
I already "fixed" that book by hand, adding H2 tags for the chapters and regenerating the TOC. But next time i'll know what to do.