[FIX] Test encoder,decoder,toString and fix the bugs.