Adapt code to recent changes in the NotebookManager API