Bugfixes

These changes fix a couple of long-standing errors and brings the .toc number up-to-date.