fixed int overflow for int=32bit platforms. Made message protocol version auto inserted on encodes.