Small fixes to commonlib

There are mostly fixes to the ipython notebook used in the course. The tests are green: https://ci.openquake.org/job/zdevel_oq-commonlib/198