Fix stringify() with small bucket sizes.

Now works when the buckets are smaller than the dataset.