Fix encoded value bug