             // Update tile status if this is not the last tile
             if (!IS_LAST_TILE)
                 tile_state.SetInclusive(0, tile_aggregate);
-
-            // Unset first flag in first tile
-            segment_flags[0] = 0;
 
             // Initialize the segment index for the first scan item if necessary (the exclusive prefix for the first item is garbage)
             if (!HAS_IDENTITY_ZERO)


        __syncthreads();

        for (int item = (IS_FIRST_TILE ? threadIdx.x + 1 : threadIdx.x); item < num_tile_segments; item += BLOCK_THREADS)
        {
            d_unique_out[num_tile_segments_prefix + item] = temp_storage.raw_exchange_keys.Alias()[item];
        }

        {
            if (segment_flags[ITEM])
            {
                temp_storage.raw_exchange_values.Alias()[segment_indices[ITEM] - num_tile_segments_prefix] = values[ITEM];
            }
        }

        __syncthreads();

        int first_value = (IS_FIRST_TILE) ? threadIdx.x + 1 : threadIdx.x;
        int last_value = (IS_LAST_TILE) ? CUB_MIN(num_tile_segments + 1, TILE_ITEMS) : num_tile_segments;
        for (int item = first_value; item < last_value; item += BLOCK_THREADS)
        {
            d_aggregates_out[num_tile_segments_prefix + item - 1] = temp_storage.raw_exchange_values.Alias()[item];
        }
    }

