Fixing a bug in the indexing of the nrSamplesPerBin.