 
     // Allocate host arrays
     Key     *h_keys             = new Key[num_items];
-    Key     *h_reference_keys   = new Key[num_items];
     Value   *h_values           = (KEYS_ONLY) ? NULL : new Value[num_items];
-    Value   *h_reference_values = (KEYS_ONLY) ? NULL : new Value[num_items];
+
+    Key     *h_reference_keys;
+    Value   *h_reference_values;
 
     // Initialize problem and solution on host
     Initialize<DESCENDING>(
         gen_mode,
         h_keys,
         h_values,
-        h_reference_keys,
-        h_reference_values,
+        &h_reference_keys,
+        &h_reference_values,
         num_items,
         entropy_reduction,
         begin_bit,

    Test<CUB, unsigned int, NullType, false> (num_items, RANDOM, entropy_reduction, 0, g_bits, CUB_TYPE_STRING(unsigned int));
    Test<THRUST, unsigned int, NullType, false> (num_items, RANDOM, entropy_reduction, 0, g_bits, CUB_TYPE_STRING(unsigned int));

    // Compare CUB and thrust on 32b key-value pairs
    Test<CUB, unsigned int, unsigned int, false> (num_items, RANDOM, entropy_reduction, 0, g_bits, CUB_TYPE_STRING(unsigned int));
    Test<THRUST, unsigned int, unsigned int, false> (num_items, RANDOM, entropy_reduction, 0, g_bits, CUB_TYPE_STRING(unsigned int));

#else

    // Compile/run thorough tests

    GenMode         gen_mode,
    Key             *h_keys,
    Value           *h_values,
    Key             **h_reference_keys,
    Value           **h_reference_values,
    int             num_items,
    int             entropy_reduction,
    int             begin_bit,
