fix critical bug in branching and inheriting with table of contents