The TOC structure is wrongly built when there is only one heading in the toc scope. I think the second ul tag is not necessary.  That is caused by getTopLevel() function, that in this case returns 1 as the top level.