diff --git a/lib/cpp/protocol/TBinaryProtocol.cc b/lib/cpp/protocol/TBinaryProtocol.cc
index 1f31c8d..666a6a4 100644
--- a/lib/cpp/protocol/TBinaryProtocol.cc
+++ b/lib/cpp/protocol/TBinaryProtocol.cc
@@ -16,7 +16,7 @@
                                           const uint16_t fieldId) const {
   return
     writeByte(out, (uint8_t)fieldType) +
-    writeU32(out, (uint32_t)fieldId);
+    writeI32(out, (int32_t)fieldId);
 }
 
 uint32_t TBinaryProtocol::writeFieldEnd(TTransport* out) const {
@@ -31,11 +31,11 @@
 uint32_t TBinaryProtocol::writeMapBegin(TTransport* out,
                                         const TType keyType,
                                         const TType valType,
-                                        const uint32_t size) const {
+                                        const int32_t size) const {
   return
     writeByte(out, (uint8_t)keyType) +
     writeByte(out, (uint8_t)valType) +
-    writeU32(out, size);
+    writeI32(out, (int32_t)size);
 }
 
 uint32_t TBinaryProtocol::writeMapEnd(TTransport* out) const {
@@ -44,10 +44,10 @@
 
 uint32_t TBinaryProtocol::writeListBegin(TTransport* out,
                                          const TType elemType,
-                                         const uint32_t size) const {
+                                         const int32_t size) const {
   return
     writeByte(out, (uint8_t) elemType) +
-    writeU32(out, size);
+    writeI32(out, (int32_t)size);
 }
 
 uint32_t TBinaryProtocol::writeListEnd(TTransport* out) const {
@@ -56,10 +56,10 @@
 
 uint32_t TBinaryProtocol::writeSetBegin(TTransport* out,
                                         const TType elemType,
-                                        const uint32_t size) const {
+                                        const int32_t size) const {
   return
     writeByte(out, (uint8_t)elemType) +
-    writeU32(out, size);
+    writeI32(out, (int32_t)size);
 }
 
 uint32_t TBinaryProtocol::writeSetEnd(TTransport* out) const {
@@ -102,7 +102,7 @@
 
 uint32_t TBinaryProtocol::writeString(TTransport* out,
                                       const string& str) const {
-  uint32_t result = writeU32(out, str.size());
+  uint32_t result = writeI32(out, str.size());
   out->write((uint8_t*)str.data(), str.size());
   return result + str.size();
 }
@@ -133,8 +133,8 @@
     fieldId = 0;
     return result;
   }
-  uint32_t id;
-  result += readU32(in, id);
+  int32_t id;
+  result += readI32(in, id);
   fieldId = (uint16_t)id;
   return result;
 }
@@ -146,14 +146,14 @@
 uint32_t TBinaryProtocol::readMapBegin(TTransport* in,
                                        TType& keyType,
                                        TType& valType,
-                                       uint32_t& size) const {
+                                       int32_t& size) const {
   uint8_t k, v;
   uint32_t result = 0;
   result += readByte(in, k);
   keyType = (TType)k;
   result += readByte(in, v);
   valType = (TType)v;
-  result += readU32(in, size);
+  result += readI32(in, size);
   return result;
 }
 
@@ -163,12 +163,12 @@
 
 uint32_t TBinaryProtocol::readListBegin(TTransport* in,
                                         TType& elemType,
-                                        uint32_t& size) const {
+                                        int32_t& size) const {
   uint8_t e;
   uint32_t result = 0;
   result += readByte(in, e);
   elemType = (TType)e;
-  result += readU32(in, size);
+  result += readI32(in, size);
   return result;
 }
 
@@ -178,12 +178,12 @@
 
 uint32_t TBinaryProtocol::readSetBegin(TTransport* in,
                                        TType& elemType,
-                                       uint32_t& size) const {
+                                       int32_t& size) const {
   uint8_t e;
   uint32_t result = 0;
   result += readByte(in, e);
   elemType = (TType)e;
-  result += readU32(in, size);
+  result += readI32(in, size);
   return result;
 }
 
@@ -237,10 +237,11 @@
 
 uint32_t TBinaryProtocol::readString(TTransport* in,
                                      string& str) const {
-  uint32_t size, result;
-  result = readU32(in, size);
+  uint32_t result;
+  int32_t size;
+  result = readI32(in, size);
   uint8_t b[size];
   in->readAll(b, size);
   str = string((char*)b, size);
-  return result+size;
+  return result + (uint32_t)size;
 }
diff --git a/lib/cpp/protocol/TBinaryProtocol.h b/lib/cpp/protocol/TBinaryProtocol.h
index e05bd9f..ea0bd25 100644
--- a/lib/cpp/protocol/TBinaryProtocol.h
+++ b/lib/cpp/protocol/TBinaryProtocol.h
@@ -35,19 +35,19 @@
   uint32_t writeMapBegin      (TTransport*    out,
                                const TType    keyType,
                                const TType    valType,
-                               const uint32_t size)       const;
+                               const int32_t  size)       const;
 
   uint32_t writeMapEnd        (TTransport*    out)        const;
 
   uint32_t writeListBegin     (TTransport*    out,
                                const TType    elemType,
-                               const uint32_t size)       const;
+                               const int32_t  size)       const;
 
   uint32_t writeListEnd       (TTransport*    out)        const;
 
   uint32_t writeSetBegin      (TTransport*    out,
                                const TType    elemType,
-                               const uint32_t size)       const;
+                               const int32_t  size)       const;
 
   uint32_t writeSetEnd        (TTransport*    out)        const;
 
@@ -88,19 +88,19 @@
   uint32_t readMapBegin       (TTransport*    in,
                                TType&         keyType,
                                TType&         valType,
-                               uint32_t&      size)       const;
+                               int32_t&       size)       const;
 
   uint32_t readMapEnd         (TTransport*    in)         const;
 
   uint32_t readListBegin      (TTransport*    in,
                                TType&         elemType,
-                               uint32_t&      size)       const;
+                               int32_t&       size)       const;
   
   uint32_t readListEnd        (TTransport*    in)         const;
 
   uint32_t readSetBegin       (TTransport*    in,
                                TType&         elemType,
-                               uint32_t&      size)       const;
+                               int32_t&       size)       const;
 
   uint32_t readSetEnd         (TTransport*    in)         const;
 
diff --git a/lib/cpp/protocol/TProtocol.h b/lib/cpp/protocol/TProtocol.h
index fe2d6ef..0007406 100644
--- a/lib/cpp/protocol/TProtocol.h
+++ b/lib/cpp/protocol/TProtocol.h
@@ -73,19 +73,19 @@
   virtual uint32_t writeMapBegin      (TTransport*    out,
                                        const TType    keyType,
                                        const TType    valType,
-                                       const uint32_t size)       const = 0;
+                                       const int32_t  size)       const = 0;
 
   virtual uint32_t writeMapEnd        (TTransport*    out)        const = 0;
 
   virtual uint32_t writeListBegin     (TTransport*    out,
                                        const TType    elemType,
-                                       const uint32_t size)       const = 0;
+                                       const int32_t  size)       const = 0;
 
   virtual uint32_t writeListEnd       (TTransport*    out)        const = 0;
 
   virtual uint32_t writeSetBegin      (TTransport*    out,
                                        const TType    elemType,
-                                       const uint32_t size)       const = 0;
+                                       const int32_t  size)       const = 0;
 
   virtual uint32_t writeSetEnd        (TTransport*    out)        const = 0;
 
@@ -126,19 +126,19 @@
   virtual uint32_t readMapBegin       (TTransport*    in,
                                        TType&         keyType,
                                        TType&         valType,
-                                       uint32_t&      size)       const = 0;
+                                       int32_t&       size)       const = 0;
 
   virtual uint32_t readMapEnd         (TTransport*    in)         const = 0;
 
   virtual uint32_t readListBegin      (TTransport*    in,
                                        TType&         elemType,
-                                       uint32_t&      size)       const = 0;
+                                       int32_t&       size)       const = 0;
 
   virtual uint32_t readListEnd        (TTransport*    in)         const = 0;
 
   virtual uint32_t readSetBegin       (TTransport*    in,
                                        TType&         elemType,
-                                       uint32_t&      size)       const = 0;
+                                       int32_t&       size)       const = 0;
 
   virtual uint32_t readSetEnd         (TTransport*    in)         const = 0;
 
@@ -218,7 +218,7 @@
         uint32_t result = 0;
         TType keyType;
         TType valType;
-        uint32_t i, size;
+        int32_t i, size;
         result += readMapBegin(in, keyType, valType, size);
         for (i = 0; i < size; i++) {
           result += skip(in, keyType);
@@ -231,7 +231,7 @@
       {
         uint32_t result = 0;
         TType elemType;
-        uint32_t i, size;
+        int32_t i, size;
         result += readSetBegin(in, elemType, size);
         for (i = 0; i < size; i++) {
           result += skip(in, elemType);
@@ -243,7 +243,7 @@
       {
         uint32_t result = 0;
         TType elemType;
-        uint32_t i, size;
+        int32_t i, size;
         result += readListBegin(in, elemType, size);
         for (i = 0; i < size; i++) {
           result += skip(in, elemType);
diff --git a/lib/java/src/protocol/TBinaryProtocol.java b/lib/java/src/protocol/TBinaryProtocol.java
index 3aaa06b..b2e77d9 100644
--- a/lib/java/src/protocol/TBinaryProtocol.java
+++ b/lib/java/src/protocol/TBinaryProtocol.java
@@ -23,7 +23,7 @@
                                TField     field)   throws TException {
     return
       writeByte(out, field.type.getCode()) +
-      writeU32(out, field.id);
+      writeI32(out, field.id);
   }
 
   public int writeFieldEnd    (TTransport out)     throws TException {
@@ -40,7 +40,7 @@
     return
       writeByte(out, map.keyType.getCode()) +
       writeByte(out, map.valueType.getCode()) +
-      writeU32(out, map.size);
+      writeI32(out, map.size);
   }
 
   public int writeMapEnd      (TTransport out)     throws TException {
@@ -51,7 +51,7 @@
                                TList      list)    throws TException {
     return
       writeByte(out, list.elemType.getCode()) +
-      writeU32(out, list.size);
+      writeI32(out, list.size);
   }
 
   public int writeListEnd     (TTransport out)     throws TException {
@@ -62,7 +62,7 @@
                                TSet       set)     throws TException {
     return
       writeByte(out, set.elemType.getCode()) +
-      writeU32(out, set.size);
+      writeI32(out, set.size);
   }
 
   public int writeSetEnd      (TTransport out)     throws TException {
@@ -102,7 +102,7 @@
   public int writeString      (TTransport out,
                                TString    str)     throws TException {
     byte[] dat = str.value.getBytes();
-    int sent = writeU32(out, new UInt32(dat.length));
+    int sent = writeI32(out, new Int32(dat.length));
     out.write(dat, 0, dat.length);
     return sent + dat.length;
   }
@@ -129,10 +129,10 @@
     recv += readByte(in, t);
     field.type = TType.getType(t);
     if (field.type.equals(TType.STOP)) {
-      field.id = new UInt32(0);
+      field.id = new Int32(0);
       return recv;
     }
-    recv += readU32(in, field.id);
+    recv += readI32(in, field.id);
     return recv;
   }
   
@@ -148,7 +148,7 @@
     map.keyType = TType.getType(t);
     recv += readByte(in, t);
     map.valueType = TType.getType(t);
-    recv += readU32(in, map.size);
+    recv += readI32(in, map.size);
     return recv;
   }
 
@@ -162,7 +162,7 @@
     UInt8 t = new UInt8();
     recv += readByte(in, t);
     list.elemType = TType.getType(t);
-    recv += readU32(in, list.size);
+    recv += readI32(in, list.size);
     return recv;
   }
 
@@ -176,7 +176,7 @@
     UInt8 t = new UInt8();
     recv += readByte(in, t);
     set.elemType = TType.getType(t);
-    recv += readU32(in, set.size);
+    recv += readI32(in, set.size);
     return recv;
   }
 
@@ -226,11 +226,11 @@
 
   public int readString       (TTransport  in,
                                TString     s)      throws TException {
-    UInt32 size = new UInt32();
-    int recv = readU32(in, size);
-    byte[] buf = new byte[size.toInt()];
-    in.readAll(buf, 0, size.toInt());
+    Int32 size = new Int32();
+    int recv = readI32(in, size);
+    byte[] buf = new byte[size.get()];
+    in.readAll(buf, 0, size.get());
     s.value = new String(buf);
-    return recv + size.toInt();
+    return recv + size.get();
   }
 }
diff --git a/lib/java/src/protocol/TField.java b/lib/java/src/protocol/TField.java
index 83f1fc3..d758c68 100644
--- a/lib/java/src/protocol/TField.java
+++ b/lib/java/src/protocol/TField.java
@@ -11,10 +11,10 @@
   public TField() {}
 
   public TField(String n, TType t, int i) {
-    this(n, t, new UInt32(i));
+    this(n, t, new Int32(i));
   }
 
-  public TField(String n, TType t, UInt32 i) {
+  public TField(String n, TType t, Int32 i) {
     name = n;
     type = t;
     id = i;
@@ -22,5 +22,5 @@
 
   public String name = "";
   public TType  type = TType.STOP;
-  public UInt32 id = new UInt32();
+  public Int32 id = new Int32();
 }
diff --git a/lib/java/src/protocol/TList.java b/lib/java/src/protocol/TList.java
index 6eac06b..ff76ffd 100644
--- a/lib/java/src/protocol/TList.java
+++ b/lib/java/src/protocol/TList.java
@@ -11,14 +11,14 @@
   public TList() {}
   
   public TList(TType t, int s) {
-    this(t, new UInt32(s));
+    this(t, new Int32(s));
   }
 
-  public TList(TType t, UInt32 s) {
+  public TList(TType t, Int32 s) {
     elemType = t;
     size = s;
   }
 
   public TType  elemType = TType.STOP;
-  public UInt32 size = new UInt32();
+  public Int32 size = new Int32();
 }
diff --git a/lib/java/src/protocol/TMap.java b/lib/java/src/protocol/TMap.java
index 84eb468..f251fa6 100644
--- a/lib/java/src/protocol/TMap.java
+++ b/lib/java/src/protocol/TMap.java
@@ -11,10 +11,10 @@
   public TMap() {}
   
   public TMap(TType k, TType v, int s) {
-    this(k, v, new UInt32(s));
+    this(k, v, new Int32(s));
   }
 
-  public TMap(TType k, TType v, UInt32 s) {
+  public TMap(TType k, TType v, Int32 s) {
     keyType = k;
     valueType = v;
     size = s;
@@ -22,5 +22,5 @@
 
   public TType  keyType = TType.STOP;
   public TType  valueType = TType.STOP;
-  public UInt32 size = new UInt32();;
+  public Int32 size = new Int32();;
 }
diff --git a/lib/java/src/protocol/TSet.java b/lib/java/src/protocol/TSet.java
index e0dcf76..fa6e24d 100644
--- a/lib/java/src/protocol/TSet.java
+++ b/lib/java/src/protocol/TSet.java
@@ -11,14 +11,14 @@
   public TSet() {}
 
   public TSet(TType t, int s) {
-    this(t, new UInt32(s));
+    this(t, new Int32(s));
   }
 
-  public TSet(TType t, UInt32 s) {
+  public TSet(TType t, Int32 s) {
     elemType = t;
     size = s;
   }
 
   public TType  elemType = TType.STOP;
-  public UInt32 size = new UInt32();
+  public Int32 size = new Int32();
 }
