Code improvements for the notebooks.py module.