             void* allocations[1];
             size_t allocation_sizes[1] =
             {
-                NUM_ACTIVE_CHANNELS * histogram_sweep_grid_blocks * sizeof(CounterT) * MAX_PRIVATIZED_BINS,     // bytes needed for privatized histograms
+                NUM_ACTIVE_CHANNELS * histogram_sweep_grid_blocks * sizeof(CounterT) * max_bins,     // bytes needed for privatized histograms
             };
 
             // Alias the temporary allocations from the single storage blob (or compute the necessary size of the blob)

    };


    // Scale-free sample transform used for the the common-case of 8b samples and 256 evenly-spaced bins (specialized for int8)
    template <typename SampleT, int DUMMY = 0>
    struct ScaleFreeTransform
    {
        // Method for converting samples to bin-ids
        template <CacheLoadModifier LOAD_MODIFIER>
        __host__ __device__ __forceinline__ void BinSelect(SampleT sample, unsigned int &bin, bool &valid)
        {
            bin = ((unsigned int) sample) + 128;
        }
    };

    // Scale-free sample transform used for the the common-case of 8b samples and 256 evenly-spaced bins (specialized for unsigend int8)
    template <int DUMMY>
    struct ScaleFreeTransform<unsigned char, DUMMY>
    {
        // Method for converting samples to bin-ids
        template <CacheLoadModifier LOAD_MODIFIER>
        __host__ __device__ __forceinline__ void BinSelect(SampleT sample, unsigned int &bin, bool &valid)
        {
            bin = (unsigned int) sample;
        }
    };


            if ((sizeof(SampleT) == 1) && (max_bins == 256) && (min_bins == 256))
            {
                // Dispatch privatized approach for the common scenario (8-bit samples with 256 bins in every channel) using efficient scale-free transformer
                ScaleFreeTransform transform_op[NUM_ACTIVE_CHANNELS];

                if (CubDebug(error = PrivatizedDispatch(
                    d_temp_storage,
