Fixing a bug with generating sample data