diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/Thrift.h
index 1f98d82..9254b56 100644
--- a/lib/cpp/src/Thrift.h
+++ b/lib/cpp/src/Thrift.h
@@ -9,7 +9,7 @@
 #include <set>
 #include <exception>
 
-namespace facebook {namespace thrift {
+namespace facebook { namespace thrift {
 
 class Exception : public std::exception {
 private:
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.cc b/lib/cpp/src/protocol/TBinaryProtocol.cc
index f2fbe87..51c9306 100644
--- a/lib/cpp/src/protocol/TBinaryProtocol.cc
+++ b/lib/cpp/src/protocol/TBinaryProtocol.cc
@@ -7,11 +7,11 @@
 uint32_t TBinaryProtocol::writeMessageBegin(shared_ptr<TTransport> out,
 					    const std::string name,
 					    const TMessageType messageType,
-					    const uint32_t seqid) const {
+					    const int32_t seqid) const {
   return 
     writeString(out, name) + 
-    writeByte(out, (uint8_t)messageType) +
-    writeU32(out, seqid);
+    writeByte(out, (int8_t)messageType) +
+    writeI32(out, seqid);
 }
 
 uint32_t TBinaryProtocol::writeMessageEnd(shared_ptr<TTransport> out) const {
@@ -32,7 +32,7 @@
                                           const TType fieldType,
                                           const int16_t fieldId) const {
   return
-    writeByte(out, (uint8_t)fieldType) +
+    writeByte(out, (int8_t)fieldType) +
     writeI16(out, fieldId);
 }
 
@@ -42,7 +42,7 @@
 
 uint32_t TBinaryProtocol::writeFieldStop(shared_ptr<TTransport> out) const {
   return
-    writeByte(out, (uint8_t)T_STOP);
+    writeByte(out, (int8_t)T_STOP);
 }  
                                
 uint32_t TBinaryProtocol::writeMapBegin(shared_ptr<TTransport> out,
@@ -50,9 +50,9 @@
                                         const TType valType,
                                         const uint32_t size) const {
   return
-    writeByte(out, (uint8_t)keyType) +
-    writeByte(out, (uint8_t)valType) +
-    writeU32(out, (uint32_t)size);
+    writeByte(out, (int8_t)keyType) +
+    writeByte(out, (int8_t)valType) +
+    writeI32(out, (int32_t)size);
 }
 
 uint32_t TBinaryProtocol::writeMapEnd(shared_ptr<TTransport> out) const {
@@ -63,8 +63,8 @@
                                          const TType elemType,
                                          const uint32_t size) const {
   return
-    writeByte(out, (uint8_t) elemType) +
-    writeU32(out, (int32_t)size);
+    writeByte(out, (int8_t) elemType) +
+    writeI32(out, (int32_t)size);
 }
 
 uint32_t TBinaryProtocol::writeListEnd(shared_ptr<TTransport> out) const {
@@ -75,8 +75,8 @@
                                         const TType elemType,
                                         const uint32_t size) const {
   return
-    writeByte(out, (uint8_t)elemType) +
-    writeU32(out, (int32_t)size);
+    writeByte(out, (int8_t)elemType) +
+    writeI32(out, (int32_t)size);
 }
 
 uint32_t TBinaryProtocol::writeSetEnd(shared_ptr<TTransport> out) const {
@@ -91,18 +91,11 @@
 }
 
 uint32_t TBinaryProtocol::writeByte(shared_ptr<TTransport> out,
-                                    const uint8_t byte) const {
-  out->write(&byte, 1);
+                                    const int8_t byte) const {
+  out->write((uint8_t*)&byte, 1);
   return 1;
 }
 
-uint32_t TBinaryProtocol::writeU16(shared_ptr<TTransport> out,
-                                   const uint16_t u16) const {
-  uint16_t net = (uint16_t)htons(u16);
-  out->write((uint8_t*)&net, 2);
-  return 2;
-}
-
 uint32_t TBinaryProtocol::writeI16(shared_ptr<TTransport> out,
                                    const int16_t i16) const {
   int16_t net = (int16_t)htons(i16);
@@ -110,13 +103,6 @@
   return 2;
 }
 
-uint32_t TBinaryProtocol::writeU32(shared_ptr<TTransport> out,
-                                   const uint32_t u32) const {
-  uint32_t net = (uint32_t)htonl(u32);
-  out->write((uint8_t*)&net, 4);
-  return 4;
-}
-
 uint32_t TBinaryProtocol::writeI32(shared_ptr<TTransport> out,
                                    const int32_t i32) const {
   int32_t net = (int32_t)htonl(i32);
@@ -124,13 +110,6 @@
   return 4;
 }
 
-uint32_t TBinaryProtocol::writeU64(shared_ptr<TTransport> out,
-                                   const uint64_t u64) const {
-  uint64_t net = (uint64_t)htonll(u64);
-  out->write((uint8_t*)&net, 8);
-  return 8;
-}
-
 uint32_t TBinaryProtocol::writeI64(shared_ptr<TTransport> out,
                                    const int64_t i64) const {
   int64_t net = (int64_t)htonll(i64);
@@ -152,14 +131,14 @@
 uint32_t TBinaryProtocol::readMessageBegin(shared_ptr<TTransport> in,
 					   std::string& name,
 					   TMessageType& messageType,
-					   uint32_t& seqid) const {
+					   int32_t& seqid) const {
 
   uint32_t result = 0;
-  uint8_t type;
+  int8_t type;
   result+= readString(in, name);
   result+=  readByte(in, type);
   messageType = (TMessageType)type;
-  result+= readU32(in, seqid);
+  result+= readI32(in, seqid);
   return result;
 }
 
@@ -182,7 +161,7 @@
                                          TType& fieldType,
                                          int16_t& fieldId) const {
   uint32_t result = 0;
-  uint8_t type;
+  int8_t type;
   result += readByte(in, type);
   fieldType = (TType)type;
   if (fieldType == T_STOP) {
@@ -201,13 +180,16 @@
                                        TType& keyType,
                                        TType& valType,
                                        uint32_t& size) const {
-  uint8_t k, v;
+  int8_t k, v;
   uint32_t result = 0;
+  int32_t sizei;
   result += readByte(in, k);
   keyType = (TType)k;
   result += readByte(in, v);
   valType = (TType)v;
-  result += readU32(in, size);
+  result += readI32(in, sizei);
+  // TODO(mcslee): check for negative size
+  size = (uint32_t)sizei;
   return result;
 }
 
@@ -218,11 +200,14 @@
 uint32_t TBinaryProtocol::readListBegin(shared_ptr<TTransport> in,
                                         TType& elemType,
                                         uint32_t& size) const {
-  uint8_t e;
+  int8_t e;
   uint32_t result = 0;
+  int32_t sizei;
   result += readByte(in, e);
   elemType = (TType)e;
-  result += readU32(in, size);
+  result += readI32(in, sizei);
+  // TODO(mcslee): check for negative size
+  size = (uint32_t)sizei;
   return result;
 }
 
@@ -233,11 +218,14 @@
 uint32_t TBinaryProtocol::readSetBegin(shared_ptr<TTransport> in,
                                        TType& elemType,
                                        uint32_t& size) const {
-  uint8_t e;
+  int8_t e;
   uint32_t result = 0;
+  int32_t sizei;
   result += readByte(in, e);
   elemType = (TType)e;
-  result += readU32(in, size);
+  result += readI32(in, sizei);
+  // TODO(mcslee): check for negative size
+  size = (uint32_t)sizei;
   return result;
 }
 
@@ -249,27 +237,18 @@
                                    bool& value) const {
   uint8_t b[1];
   in->readAll(b, 1);
-  value = *(uint8_t*)b != 0;
+  value = *(int8_t*)b != 0;
   return 1;
 }
 
 uint32_t TBinaryProtocol::readByte(shared_ptr<TTransport> in,
-                                   uint8_t& byte) const {
+                                   int8_t& byte) const {
   uint8_t b[1];
   in->readAll(b, 1);
-  byte = *(uint8_t*)b;
+  byte = *(int8_t*)b;
   return 1;
 }
 
-uint32_t TBinaryProtocol::readU16(shared_ptr<TTransport> in,
-                                  uint16_t& u16) const {
-  uint8_t b[2];
-  in->readAll(b, 2);
-  u16 = *(uint16_t*)b;
-  u16 = (uint16_t)ntohs(u16);
-  return 2;
-}
-
 uint32_t TBinaryProtocol::readI16(shared_ptr<TTransport> in,
                                   int16_t& i16) const {
   uint8_t b[2];
@@ -279,15 +258,6 @@
   return 2;
 }
 
-uint32_t TBinaryProtocol::readU32(shared_ptr<TTransport> in,
-                                  uint32_t& u32) const {
-  uint8_t b[4];
-  in->readAll(b, 4);
-  u32 = *(uint32_t*)b;
-  u32 = (uint32_t)ntohl(u32);
-  return 4;
-}
-
 uint32_t TBinaryProtocol::readI32(shared_ptr<TTransport> in,
                                   int32_t& i32) const {
   uint8_t b[4];
@@ -297,15 +267,6 @@
   return 4;
 }
 
-uint32_t TBinaryProtocol::readU64(shared_ptr<TTransport> in,
-                                  uint64_t& u64) const {
-  uint8_t b[8];
-  in->readAll(b, 8);
-  u64 = *(uint64_t*)b;
-  u64 = (uint64_t)ntohll(u64);
-  return 8;
-}
-
 uint32_t TBinaryProtocol::readI64(shared_ptr<TTransport> in,
                                   int64_t& i64) const {
   uint8_t b[8];
@@ -318,8 +279,10 @@
 uint32_t TBinaryProtocol::readString(shared_ptr<TTransport> in,
                                      string& str) const {
   uint32_t result;
-  uint32_t size;
-  result = readU32(in, size);
+  int32_t size;
+  result = readI32(in, size);
+
+  // TODO(mcslee): check for negative size
 
   // Use the heap here to prevent stack overflow for v. large strings
   uint8_t *b = new uint8_t[size];
@@ -329,4 +292,5 @@
 
   return result + (uint32_t)size;
 }
+
 }}} // facebook::thrift::protocol
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.h b/lib/cpp/src/protocol/TBinaryProtocol.h
index 7780f16..d66fa2f 100644
--- a/lib/cpp/src/protocol/TBinaryProtocol.h
+++ b/lib/cpp/src/protocol/TBinaryProtocol.h
@@ -27,7 +27,7 @@
   virtual uint32_t writeMessageBegin(shared_ptr<TTransport> out,
 				     const std::string name,
 				     const TMessageType messageType,
-				     const uint32_t seqid) const;
+				     const int32_t seqid) const;
 
   virtual uint32_t writeMessageEnd(shared_ptr<TTransport> out) const;
 
@@ -69,23 +69,14 @@
 		      const bool value) const;
 
   uint32_t writeByte(shared_ptr<TTransport> out,
-		      const uint8_t byte) const;
-
-  uint32_t writeU16(shared_ptr<TTransport> out,
-		    const uint16_t u16) const;
+		      const int8_t byte) const;
 
   uint32_t writeI16(shared_ptr<TTransport> out,
 		     const int16_t i16) const;
 
-  uint32_t writeU32(shared_ptr<TTransport> out,
-		     const uint32_t u32) const;
-
   uint32_t writeI32(shared_ptr<TTransport> out,
 		     const int32_t i32) const;
 
-  uint32_t writeU64(shared_ptr<TTransport> out,
-		     const uint64_t u64) const;
-
   uint32_t writeI64(shared_ptr<TTransport> out,
 		     const int64_t i64) const;
 
@@ -100,7 +91,7 @@
   uint32_t readMessageBegin(shared_ptr<TTransport> in,
 			    std::string& name,
 			    TMessageType& messageType,
-			    uint32_t& seqid) const;
+			    int32_t& seqid) const;
 
   uint32_t readMessageEnd(shared_ptr<TTransport> in) const;
 
@@ -139,23 +130,14 @@
 		      bool& value) const;
 
   uint32_t readByte(shared_ptr<TTransport> in,
-		     uint8_t& byte) const;
-
-  uint32_t readU16(shared_ptr<TTransport> in,
-		    uint16_t& u16) const;
+                    int8_t& byte) const;
 
   uint32_t readI16(shared_ptr<TTransport> in,
 		    int16_t& i16) const;
 
-  uint32_t readU32(shared_ptr<TTransport> in,
-		    uint32_t& u32) const;
-
   uint32_t readI32(shared_ptr<TTransport> in,
 		    int32_t& i32) const;
 
-  uint32_t readU64(shared_ptr<TTransport> in,
-		    uint64_t& u64) const;
-
   uint32_t readI64(shared_ptr<TTransport> in,
 		    int64_t& i64) const;
 
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h
index 092dd8d..2b3666f 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/protocol/TProtocol.h
@@ -33,11 +33,8 @@
   T_VOID       = 1,
   T_BOOL       = 2,
   T_BYTE       = 3,
-  T_U08        = 3,
-  T_I08        = 4,
-  T_U16        = 5,
+  T_I08        = 3,
   T_I16        = 6,
-  T_U32        = 7,
   T_I32        = 8,
   T_U64        = 9,
   T_I64        = 10,
@@ -82,7 +79,7 @@
   virtual uint32_t writeMessageBegin(shared_ptr<TTransport> out,
 				     const std::string name,
 				     const TMessageType messageType,
-				     const uint32_t seqid) const = 0;
+				     const int32_t seqid) const = 0;
 
   virtual uint32_t writeMessageEnd(shared_ptr<TTransport> out) const = 0;
 
@@ -124,23 +121,14 @@
 			     const bool value) const = 0;
 
   virtual uint32_t writeByte(shared_ptr<TTransport> out,
-			     const uint8_t byte) const = 0;
+			     const int8_t byte) const = 0;
 
   virtual uint32_t writeI16(shared_ptr<TTransport> out,
 			    const int16_t i16) const = 0;
 
-  virtual uint32_t writeU16(shared_ptr<TTransport> out,
-			    const uint16_t u16) const = 0;
-
-  virtual uint32_t writeU32(shared_ptr<TTransport> out,
-			    const uint32_t u32) const = 0;
-  
   virtual uint32_t writeI32(shared_ptr<TTransport> out,
 			    const int32_t i32) const = 0;
 
-  virtual uint32_t writeU64(shared_ptr<TTransport> out,
-			    const uint64_t u64) const = 0;
-
   virtual uint32_t writeI64(shared_ptr<TTransport> out,
 			    const int64_t i64) const = 0;
 
@@ -154,7 +142,7 @@
   virtual uint32_t readMessageBegin(shared_ptr<TTransport> in,
 				    std::string& name,
 				    TMessageType& messageType,
-				    uint32_t& seqid) const = 0;
+				    int32_t& seqid) const = 0;
   
   virtual uint32_t readMessageEnd(shared_ptr<TTransport> in) const = 0;
 
@@ -193,23 +181,14 @@
 			    bool& value) const = 0;
 
   virtual uint32_t readByte(shared_ptr<TTransport> in,
-			    uint8_t& byte) const = 0;
-
-  virtual uint32_t readU16(shared_ptr<TTransport> in,
-			   uint16_t& u16) const = 0;
+			    int8_t& byte) const = 0;
 
   virtual uint32_t readI16(shared_ptr<TTransport> in,
 			   int16_t& i16) const = 0;
 
-  virtual uint32_t readU32(shared_ptr<TTransport> in,
-			   uint32_t& u32) const = 0;
-
   virtual uint32_t readI32(shared_ptr<TTransport> in,
 			   int32_t& i32) const = 0;
 
-  virtual uint32_t readU64(shared_ptr<TTransport> in,
-			   uint64_t& u64) const = 0;
-
   virtual uint32_t readI64(shared_ptr<TTransport> in,
 			   int64_t& i64) const = 0;
 
@@ -223,24 +202,19 @@
     switch (type) {
     case T_BYTE:
       {
-        uint8_t byte;
+        int8_t byte;
         return readByte(in, byte);
       }
-    case T_U32:
+    case T_I16:
       {
-        uint32_t u32;
-        return readU32(in, u32);
+        int16_t i16;
+        return readI16(in, i16);
       }
     case T_I32:
       {
         int32_t i32;
         return readI32(in, i32);
       }
-    case T_U64:
-      {
-        uint64_t u64;
-        return readU64(in, u64);
-      }
     case T_I64:
       {
         int64_t i64;
diff --git a/lib/php/src/Thrift.php b/lib/php/src/Thrift.php
index 1e8f3fb..ee48092 100644
--- a/lib/php/src/Thrift.php
+++ b/lib/php/src/Thrift.php
@@ -1,5 +1,9 @@
 <?php
 
-include_once PREFIX.'thrift/protocol/TProtocol.php';
+/** Set global THRIFT ROOT automatically via inclusion here */
+if (!isset($GLOBALS['THRIFT_ROOT'])) {
+  $GLOBALS['THRIFT_ROOT'] = dirname(__FILE__);
+}
+include_once $GLOBALS['THRIFT_ROOT'].'/protocol/TProtocol.php';
 
 ?>
diff --git a/lib/php/src/protocol/TBinaryProtocol.php b/lib/php/src/protocol/TBinaryProtocol.php
index 0d2349e..4bb0297 100644
--- a/lib/php/src/protocol/TBinaryProtocol.php
+++ b/lib/php/src/protocol/TBinaryProtocol.php
@@ -1,7 +1,7 @@
 <?php
 
 /** For transport operations */
-require_once PREFIX.'thrift/transport/TTransport.php';
+require_once $GLOBALS['THRIFT_ROOT'].'/transport/TTransport.php';
 
 /**
  * Binary implementation of the Thrift protocol.
@@ -12,10 +12,10 @@
 class TBinaryProtocol extends TProtocol {
 
   public function writeMessageBegin($out, $name, $type, $seqid) {
-      return 
-        $this->writeString($out, $name) +
-        $this->writeByte($out, $type) +
-        $this->writeU32($out, $seqid);
+    return 
+      $this->writeString($out, $name) +
+      $this->writeByte($out, $type) +
+      $this->writeI32($out, $seqid);
   }
 
   public function writeMessageEnd($out) {
@@ -88,12 +88,6 @@
     return 1;
   }
 
-  public function writeI08($out, $value) {
-    $data = pack('c', $value);
-    $out->write($data, 1);
-    return 1;
-  }
-
   public function writeI16($out, $value) {
     $data = pack('n', $value);
     $out->write($data, 2);
@@ -107,25 +101,23 @@
   }
 
   public function writeI64($out, $value) {
-
-    /* If we are on a 32bit architecture we have to explicitly deal with 64-bit twos-complement arithmetic
-       since PHP wants to treat all ints as signed and any int over 2^31 - 1 as a float */
-    
-    if(PHP_INT_SIZE == 4) {
-
+    // If we are on a 32bit architecture we have to explicitly deal with
+    // 64-bit twos-complement arithmetic since PHP wants to treat all ints
+    // as signed and any int over 2^31 - 1 as a float   
+    if (PHP_INT_SIZE == 4) {
       $neg = $value < 0;
-  
-      if($neg) {
-	$value*= -1;
+
+      if ($neg) {
+	$value *= -1;
       }
-    
+   
       $hi = (int)($value / 4294967296);
       $lo = (int)$value;
     
-      if($neg) {
+      if ($neg) {
 	$hi = ~$hi;
 	$lo = ~$lo;
-	if(($lo & (int)0xffffffff) == (int)0xffffffff) {
+	if (($lo & (int)0xffffffff) == (int)0xffffffff) {
 	  $lo = 0;
 	  $hi++;
 	} else {
@@ -144,56 +136,18 @@
     return 8;
   }
 
-  public function writeU08($out, $value) {
-    $data = pack('c', $value);
-    $out->write($data, 1);
-    return 1;
-  }
-
-  public function writeU16($out, $value) {
-    $data = pack('n', $value);
-    $out->write($data, 2);
-    return 2;
-  }
-
-  public function writeU32($out, $value) {
-    $data = pack('N', $value);
-    $out->write($data, 4);
-    return 4;
-  }
-
-  public function writeU64($out, $value) {
-
-    /* If we are on a 32bit architecture we have to explicitly deal with 64-bit twos-complement arithmetic
-     since PHP wants to treat all ints as signed and any int over 2^31 - 1 as a float */
-
-    if(PHP_INT_SIZE == 4) {
-
-      $hi = (int)($value / 4294967296);
-      $lo = (int)$value;
-      $data = pack('N2', $hi, $lo);
-    
-    } else {
-      $hi = $value >> 32;
-      $lo = $value & 0xFFFFFFFF;
-      $data = pack('N2', $hi, $lo);
-    }
-    
-    $out->write($data, 8);
-    return 8;
-  }
-
   public function writeString($out, $value) {
     $len = strlen($value);
-    $result = $this->writeU32($out, $len);
+    $result = $this->writeI32($out, $len);
     $out->write($value, $len);
     return $result + $len;
   }
 
   public function readMessageBegin($in, &$name, &$type, &$seqid) {
-      $result = $this->readString($in, $name);
-      $result+= $this->readByte($in, $type);
-      $result+= $this->readU32($in, $seqid);
+    return 
+      $this->readString($in, $name) +
+      $this->readByte($in, $type) +
+      $this->readI32($in, $seqid);
   }
 
   public function readMessageEnd($out) {
@@ -224,10 +178,10 @@
   }
 
   public function readMapBegin($in, &$keyType, &$valType, &$size) {
-    $result = $this->readByte($in, $keyType);
-    $result += $this->readByte($in, $valType);
-    $result += $this->readI32($in, $size);
-    return $result;
+    return
+      $this->readByte($in, $keyType) +
+      $this->readByte($in, $valType) +
+      $this->readI32($in, $size);
   }
 
   public function readMapEnd($in) {
@@ -235,9 +189,9 @@
   }
 
   public function readListBegin($in, &$elemType, &$size) {
-    $result = $this->readByte($in, $elemType);
-    $result += $this->readI32($in, $size);
-    return $result;
+    return
+      $this->readByte($in, $elemType) +
+      $this->readI32($in, $size);
   }
 
   public function readListEnd($in) {
@@ -245,9 +199,9 @@
   }
 
   public function readSetBegin($in, &$elemType, &$size) {
-    $result = $this->readByte($in, $elemType);
-    $result += $this->readI32($in, $size);
-    return $result;
+    return
+      $this->readByte($in, $elemType) +
+      $this->readI32($in, $size);
   }
 
   public function readSetEnd($in) {
@@ -268,19 +222,12 @@
     return 1;
   }
 
-  public function readI08($in, &$value) {
-    $data = $in->readAll(1);
-    $arr = unpack('c', $data);
-    $value = $arr[1];
-    return 1;
-  }
-
   public function readI16($in, &$value) {
     $data = $in->readAll(2);
     $arr = unpack('n', $data);
     $value = $arr[1];
-    if($value > 0x7fff) {
-        $value = 0 - (($value - 1) ^ 0xffff);
+    if ($value > 0x7fff) {
+      $value = 0 - (($value - 1) ^ 0xffff);
     }
     return 2;
   }
@@ -289,33 +236,32 @@
     $data = $in->readAll(4);
     $arr = unpack('N', $data);
     $value = $arr[1];
-    if($value > 0x7fffffff) {
+    if ($value > 0x7fffffff) {
       $value = 0 - (($value - 1) ^ 0xffffffff);
     }
     return 4;
   }
 
   public function readI64($in, &$value) {
-
     $data = $in->readAll(8);
 
     $arr = unpack('N2', $data);
     
-    /* If we are on a 32bit architecture we have to explicitly deal with 64-bit twos-complement arithmetic
-     since PHP wants to treat all ints as signed and any int over 2^31 - 1 as a float */
-
-    if(PHP_INT_SIZE == 4) {
+    // If we are on a 32bit architecture we have to explicitly deal with
+    // 64-bit twos-complement arithmetic since PHP wants to treat all ints
+    // as signed and any int over 2^31 - 1 as a float
+    if (PHP_INT_SIZE == 4) {
 
       $hi = $arr[1];
       $lo = $arr[2];
       $isNeg = $hi  < 0;
     
       // Check for a negative
-      if($isNeg) {
+      if ($isNeg) {
 	$hi = ~$hi & (int)0xffffffff;
 	$lo = ~$lo & (int)0xffffffff;
 
-	if($lo == (int)0xffffffff) {
+	if ($lo == (int)0xffffffff) {
 	  $hi++;
 	  $lo = 0;
 	} else {
@@ -323,22 +269,22 @@
 	}
       }
 
-      /* Force 32bit words in excess of 2G to pe positive - we deal wigh sign
-       explicitly below */
+      // Force 32bit words in excess of 2G to pe positive - we deal wigh sign
+      // explicitly below
       
-      if($hi & (int)0x80000000) {
-	$hi&= (int)0x7fffffff;
+      if ($hi & (int)0x80000000) {
+	$hi &= (int)0x7fffffff;
 	$hi += 0x80000000;
       }
       
-      if($lo & (int)0x80000000) {
-	$lo&= (int)0x7fffffff;
+      if ($lo & (int)0x80000000) {
+	$lo &= (int)0x7fffffff;
 	$lo += 0x80000000;
       }
     
       $value = $hi * 4294967296 + $lo;
 
-      if($isNeg) {
+      if ($isNeg) {
 	$value = 0 - $value;
       }
     } else {
@@ -356,62 +302,8 @@
     return 8;
   }
 
-  public function readU08($in, &$value) {
-    $data = $in->readAll(1);
-    $arr = unpack('c', $data);
-    $value = $arr[1];
-    return 1;
-  }
-
-  public function readU16($in, &$value) {
-    $data = $in->readAll(2);
-    $arr = unpack('n', $data);
-    $value = $arr[1];
-    return 2;
-  }
-
-  public function readU32($in, &$value) {
-    $data = $in->readAll(4);
-    $arr = unpack('N', $data);
-    $value = $arr[1];
-    return 4;
-  }
-
-  public function readU64($in, &$value) {
-    $data = $in->readAll(8);
-    $arr = unpack('N2', $data);
-
-    /* If we are on a 32bit architecture we have to explicitly deal with 64-bit twos-complement arithmetic
-     since PHP wants to treat all ints as signed and any int over 2^31 - 1 as a float */
-
-    if(PHP_INT_SIZE == 4) {
-
-      $hi = $arr[1];
-      $lo = $arr[2];
-
-      /* Prevent implicit integer sign extension */
-    
-      if($hi & (int)0x80000000) {
-	$hi&= (int)0x7fffffff;
-	$hi += 0x80000000;
-      }
-
-      if($lo & (int)0x80000000) {
-	$lo&= (int)0x7fffffff;
-	$lo += 0x80000000;
-      }
-    
-      $value = $hi * 4294967296 + $lo;
-
-    } else {
-
-    $value = $arr[1]*4294967296 + $arr[2];
-    }
-    return 8;
-  }
-
   public function readString($in, &$value) {
-    $result = $this->readU32($in, $len);
+    $result = $this->readI32($in, $len);
     $value = $in->readAll($len);
     return $result + $len;
   }
diff --git a/lib/php/src/protocol/TProtocol.php b/lib/php/src/protocol/TProtocol.php
index a3596ab..15938df 100644
--- a/lib/php/src/protocol/TProtocol.php
+++ b/lib/php/src/protocol/TProtocol.php
@@ -1,7 +1,10 @@
 <?php
 
-/** Types */
-require_once PREFIX.'thrift/protocol/TType.php';
+/**
+ * For Type Constants
+ */
+require_once $GLOBALS['THRIFT_ROOT'].'/protocol/TType.php';
+
 
 /**
  * Protocol module.
@@ -11,19 +14,21 @@
  */
 abstract class TProtocol {
 
-  /** Writes the message header
-  
-      @param TTransport $out Output transport
-      @param name $name Function name
-      @param type $type message type TMessageType::CALL or TMessageType::REPLY
-      @parem seqid $seqid The sequence id of this message */
-
+  /** 
+   * Writes the message header
+   *
+   * @param TTransport $out Output transport
+   * @param string $name Function name
+   * @param int $type message type TMessageType::CALL or TMessageType::REPLY
+   * @param int $seqid The sequence id of this message
+   */
   public abstract function writeMessageBegin($out, $name, $type, $seqid);
 
-  /** Close the message
-  
-      @param TTransport $out Output transport */
-
+  /**
+   * Close the message
+   *
+   * @param TTransport $out Output transport
+   */
   public abstract function writeMessageEnd($out);
 
   /**
@@ -76,6 +81,8 @@
   
   public abstract function writeByte($out, $byte);
   
+  public abstract function writeI16($out, $i16);
+
   public abstract function writeI32($out, $i32);
 
   public abstract function writeI64($out, $i64);
@@ -83,19 +90,21 @@
   public abstract function writeString($out, $str);
 
 
-  /** Reads the message header
-  
-      @param TTransport $out Output transport
-      @param name $name Function name
-      @param type $type message type TMessageType::CALL or TMessageType::REPLY
-      @parem seqid $seqid The sequence id of this message */
-
+  /**
+   * Reads the message header
+   *
+   * @param TTransport $out Output transport
+   * @param string $name Function name
+   * @param int $type message type TMessageType::CALL or TMessageType::REPLY
+   * @parem int $seqid The sequence id of this message
+   */
   public abstract function readMessageBegin($out, &$name, &$type, &$seqid);
 
-  /** Read the close of message
-  
-      @param TTransport $out Output transport */
-
+  /**
+   * Read the close of message
+   *
+   * @param TTransport $out Output transport
+   */
   public abstract function readMessageEnd($out);
 
   public abstract function readStructBegin($in, &$name);
@@ -120,16 +129,27 @@
 
   public abstract function readByte($in, &$byte);
   
+  public abstract function readI16($in, &$i16);
+
   public abstract function readI32($in, &$i32);
 
   public abstract function readI64($in, &$i64);
 
   public abstract function readString($in, &$str);
 
+  /**
+   * The skip function is a utility to parse over unrecognized date without
+   * causing corruption.
+   *
+   * @param TTransport $in Input transport
+   * @param TType $type What type is it
+   */
   public function skip($in, $type) {
     switch ($type) {
     case TType::BYTE:
       return $this->readByte($in, $byte);
+    case TType::I16;
+      return $this->readI16($in, $i16);
     case TType::I32:
       return $this->readI32($in, $i32);
     case TType::I64:
diff --git a/lib/php/src/protocol/TType.php b/lib/php/src/protocol/TType.php
index e9576f9..22c1c3d 100644
--- a/lib/php/src/protocol/TType.php
+++ b/lib/php/src/protocol/TType.php
@@ -6,30 +6,35 @@
  * @package thrift.protocol
  * @author Mark Slee <mcslee@facebook.com>
  */
+
+/**
+ * Data types that can be sent via Thrift
+ */
 class TType {
   const STOP = 0;
   const VOID = 1;
   const BOOL = 2;
   const BYTE = 3;
-  const U08 = 3;
   const I08 = 4;
-  const U16 = 5;
   const I16 = 6;
-  const U32 = 7;
   const I32 = 8;
-  const U64 = 9;
   const I64 = 10;
   const STRING = 11;
   const UTF7 = 11;
   const STRUCT = 12;
   const MAP = 13;
   const SET = 14;
-  const LST = 15; // cannot use LIST keyword in PHP!
+  const LST = 15;    // N.B. cannot use LIST keyword in PHP!
   const UTF8 = 16;
   const UTF16 = 17;
 }
 
+/**
+ * Message types for RPC
+ */
 class TMessageType {
-      const CALL  = 1;
-      const REPLY  = 2;
+  const CALL  = 1;
+  const REPLY  = 2;
 }
+
+?>
