misc fix and improvements

 * fix segfault when closing the default notebook
 * improve error handling
 * initial commit of alt-tab popup