notebook cleanup and some small fixes