Fix a bug where a sharded environment and small data set resulted in missing MR steps and initialization code