notebook: fix empty notebook bugs