Add test for valueDecoding
Change some code for valueEncoding