fix encode_texpr for TVar