Fix bug in varint encoding.