Hotfix/toc url handling

Hi!

This pull request fixes some last annoying bugs that were preventing TOC from working.