correct logic error in batches_helper; closes #767