Updated code so it works with new scalalib.