Small fixes to commonlib

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