Fixed a bug in the data-splitting loop for slaves.