Remove appendice from toc

And fixed topicref level count algorithms.