Bugfix to the generate dataset script