I've fixed at least part of this at r26356. A pair of uninitialized variables was causing the size of the TOC slider to be set to huge values in certain cases.
I've also fixed the other issue I mentioned in a different post, which is that the size of the slider didn't get reset when you closed a document or switched documents. That in itself would probably have fixed this bug, but initializing the variables seems right anyway.
Richard