fix a few bugs in toc dropdown behavior