diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/ATypeHierarchy.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/ATypeHierarchy.java
index c4eef6f..254a904 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/ATypeHierarchy.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/ATypeHierarchy.java
@@ -50,20 +50,20 @@
     }
 
     public static void addPromotionRule(ATypeTag type1, ATypeTag type2, ITypePromoteComputer promoteComputer) {
-        int index = (type1.serialize() - 1) * ATypeTag.TYPE_COUNT + (type2.serialize() - 1);
+        int index = type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal();
         typeHierachyMap.set(index);
         promoteComputerMap.put(index, promoteComputer);
     }
 
     public static ITypePromoteComputer getTypePromoteComputer(ATypeTag type1, ATypeTag type2) {
         if (canPromote(type1, type2)) {
-            return promoteComputerMap.get((type1.serialize() - 1) * ATypeTag.TYPE_COUNT + (type2.serialize() - 1));
+            return promoteComputerMap.get(type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal());
         }
         return null;
     }
 
     public static boolean canPromote(ATypeTag type1, ATypeTag type2) {
-        return typeHierachyMap.get((type1.serialize() - 1) * ATypeTag.TYPE_COUNT + (type2.serialize() - 1));
+        return typeHierachyMap.get(type1.ordinal() * ATypeTag.TYPE_COUNT + type2.ordinal());
     }
 
     public static boolean isCompatible(ATypeTag type1, ATypeTag type2) {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java
index b7c1885..12bfaf4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/AbstractIntegerTypePromoteComputer.java
@@ -24,11 +24,13 @@
     public void promoteIntegerType(byte[] data, int start, int length, IMutableValueStorage storageForPromotedValue,
             ATypeTag targetType, int targetTypeLength) throws IOException {
         storageForPromotedValue.getDataOutput().writeByte(targetType.serialize());
-        int copyStart = (length < targetTypeLength) ? start : start + length - targetTypeLength;
-        int copyLength = start + length - copyStart;
-        for (int i = 0; i < targetTypeLength - copyLength; i++) {
-            storageForPromotedValue.getDataOutput().writeByte(0);
+        long num = 0;
+        for (int i = start; i < start + length; i++) {
+            num += (data[i] & 0xff) << ((length - 1 - (i - start)) * 8);
         }
-        storageForPromotedValue.getDataOutput().write(data, copyStart, copyLength);
+
+        for (int i = targetTypeLength - 1; i >= 0; i--) {
+            storageForPromotedValue.getDataOutput().writeByte((byte)((num >>> (i * 8)) & 0xFF));
+        }
     }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java
index a4b231c..014dc2a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/hierachy/IntegerToDoubleTypePromoteComputer.java
@@ -32,11 +32,11 @@
     public void promote(byte[] data, int start, int length, IMutableValueStorage storageForPromotedValue)
             throws IOException {
         storageForPromotedValue.getDataOutput().writeByte(ATypeTag.DOUBLE.serialize());
-        Long val = 0L;
+        long val = 0L;
         for (int i = 0; i < length; i++) {
             val += ((long)(data[start + i] & 0xff)) << (8 * (length - 1 - i));
         }
-        DoubleSerializerDeserializer.INSTANCE.serialize(val.doubleValue(), storageForPromotedValue.getDataOutput());
+        DoubleSerializerDeserializer.INSTANCE.serialize(Double.valueOf(val), storageForPromotedValue.getDataOutput());
     }
 
 }
