Fixed bugs in data set generation