Fix bin/regen-labels script for large datasets.