Fixed decoding/encoding errors.