fix the encoder to encode bigint, fix test