diff --git a/hyracks-algebricks/hyracks-algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/runtime/operators/aggreg/SerializableAggregatorDescriptorFactory.java b/hyracks-algebricks/hyracks-algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/runtime/operators/aggreg/SerializableAggregatorDescriptorFactory.java
index 92046d7..abfd1c1 100644
--- a/hyracks-algebricks/hyracks-algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/runtime/operators/aggreg/SerializableAggregatorDescriptorFactory.java
+++ b/hyracks-algebricks/hyracks-algebricks-core/src/main/java/edu/uci/ics/hyracks/algebricks/core/algebra/runtime/operators/aggreg/SerializableAggregatorDescriptorFactory.java
@@ -46,7 +46,6 @@
             @Override
             public void init(ArrayTupleBuilder tb, IFrameTupleAccessor accessor, int tIndex, AggregateState state)
                     throws HyracksDataException {
-                resetStateTupleBuilder(tb, keys, accessor, tIndex);
                 DataOutput output = tb.getDataOutput();
                 ftr.reset(accessor, tIndex);
                 for (int i = 0; i < aggs.length; i++) {
@@ -77,16 +76,6 @@
                 }
             }
 
-            private void resetStateTupleBuilder(ArrayTupleBuilder tb, final int[] keys, IFrameTupleAccessor accessor,
-                    int tIndex) throws HyracksDataException {
-                // reset
-                tb.reset();
-                // add keys
-                for (int i = 0; i < keys.length; i++) {
-                    tb.addField(accessor, tIndex, keys[i]);
-                }
-            }
-
             @Override
             public void aggregate(IFrameTupleAccessor accessor, int tIndex, IFrameTupleAccessor stateAccessor,
                     int stateTupleIndex, AggregateState state) throws HyracksDataException {
@@ -107,7 +96,6 @@
             @Override
             public void outputPartialResult(ArrayTupleBuilder tb, IFrameTupleAccessor accessor, int tIndex,
                     AggregateState state) throws HyracksDataException {
-                resetStateTupleBuilder(tb, keys, accessor, tIndex);
                 byte[] data = accessor.getBuffer().array();
                 int startOffset = accessor.getTupleStartOffset(tIndex);
                 int aggFieldOffset = accessor.getFieldStartOffset(tIndex, offsetFieldIndex);
@@ -127,7 +115,6 @@
             @Override
             public void outputFinalResult(ArrayTupleBuilder tb, IFrameTupleAccessor accessor, int tIndex,
                     AggregateState state) throws HyracksDataException {
-                resetStateTupleBuilder(tb, keys, accessor, tIndex);
                 byte[] data = accessor.getBuffer().array();
                 int startOffset = accessor.getTupleStartOffset(tIndex);
                 int aggFieldOffset = accessor.getFieldStartOffset(tIndex, offsetFieldIndex);
diff --git a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/ExternalGroupOperatorDescriptor.java b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/ExternalGroupOperatorDescriptor.java
index 2483470..ca17779 100644
--- a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/ExternalGroupOperatorDescriptor.java
+++ b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/ExternalGroupOperatorDescriptor.java
@@ -499,6 +499,10 @@
 
                         finalTupleBuilder.reset();
 
+                        for (int k = 0; k < storedKeys.length; k++) {
+                            finalTupleBuilder.addField(outFrameAccessor, i, storedKeys[k]);
+                        }
+
                         if (isFinal) {
 
                             aggregator.outputFinalResult(finalTupleBuilder, outFrameAccessor, i, aggregateState);
diff --git a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/HashSpillableTableFactory.java b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/HashSpillableTableFactory.java
index 831e497..7d1ecd2 100644
--- a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/HashSpillableTableFactory.java
+++ b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/HashSpillableTableFactory.java
@@ -285,6 +285,9 @@
                             storedKeysAccessor1.reset(frames.get(bIndex));
 
                             outputTupleBuilder.reset();
+                            for (int k = 0; k < storedKeys.length; k++) {
+                                outputTupleBuilder.addField(storedKeysAccessor1, tIndex, storedKeys[k]);
+                            }
 
                             if (isPartial) {
 
@@ -329,6 +332,9 @@
                     storedKeysAccessor1.reset(buffer);
 
                     outputTupleBuilder.reset();
+                    for (int k = 0; k < storedKeys.length; k++) {
+                        outputTupleBuilder.addField(storedKeysAccessor1, tupleIndex, storedKeys[k]);
+                    }
 
                     if (isPartial) {
 
diff --git a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/aggregators/MultiFieldsAggregatorFactory.java b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/aggregators/MultiFieldsAggregatorFactory.java
index 5c6e94d..6c436a9 100644
--- a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/aggregators/MultiFieldsAggregatorFactory.java
+++ b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/group/aggregators/MultiFieldsAggregatorFactory.java
@@ -80,11 +80,6 @@
             @Override
             public void outputPartialResult(ArrayTupleBuilder tupleBuilder, IFrameTupleAccessor accessor, int tIndex,
                     AggregateState state) throws HyracksDataException {
-
-                tupleBuilder.reset();
-                for (int i = 0; i < keyFieldsInPartialResults.length; i++) {
-                    tupleBuilder.addField(accessor, tIndex, keyFieldsInPartialResults[i]);
-                }
                 DataOutput dos = tupleBuilder.getDataOutput();
 
                 int tupleOffset = accessor.getTupleStartOffset(tIndex);
@@ -101,13 +96,6 @@
             @Override
             public void outputFinalResult(ArrayTupleBuilder tupleBuilder, IFrameTupleAccessor accessor, int tIndex,
                     AggregateState state) throws HyracksDataException {
-
-                tupleBuilder.reset();
-
-                for (int i = 0; i < keyFieldsInPartialResults.length; i++) {
-                    tupleBuilder.addField(accessor, tIndex, keyFieldsInPartialResults[i]);
-                }
-
                 DataOutput dos = tupleBuilder.getDataOutput();
 
                 int tupleOffset = accessor.getTupleStartOffset(tIndex);
@@ -127,11 +115,6 @@
             @Override
             public void init(ArrayTupleBuilder tupleBuilder, IFrameTupleAccessor accessor, int tIndex,
                     AggregateState state) throws HyracksDataException {
-
-                tupleBuilder.reset();
-                for (int i = 0; i < keys.length; i++) {
-                    tupleBuilder.addField(accessor, tIndex, keys[i]);
-                }
                 DataOutput dos = tupleBuilder.getDataOutput();
 
                 for (int i = 0; i < aggregators.length; i++) {
