         OffsetT (&segment_indices)[ITEMS_PER_THREAD],
         OffsetT num_segments)
     {
+        // Scatter first key of first tile and then unset the flag so we won't scatter the value
+        if (IS_FIRST_TILE && (threadIdx.x == 0))
+        {
+            segment_flags[0] = 0;
+            d_unique_out[0] = keys[0];
+        }
+
         // Scatter flagged keys and values
         #pragma unroll
         for (int ITEM = 0; ITEM < ITEMS_PER_THREAD; ++ITEM)


        __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];
        }

        OffsetT         num_tile_segments_prefix,
        OffsetT         num_segments)
    {
        // Do a one-phase scatter if (a) two-phase is disabled or (b) the average number of selected items per thread is less than one
        if (TWO_PHASE_SCATTER && (num_tile_segments > BLOCK_THREADS))
        {
