Can you elaborate? generator.add_section_internal_citations() is called in the 'else' which means that's when no attempt to specify layers has been made. 

Perhaps you mean the call to add_full_toc() later in the file? I feel like if you're asking for the chrome version, you get the TOC whether you asked for it or not. That's an integral part of the chrome.