Bug fix to data generation script