Fix the barter string which were in reversed order.
Also rename variables to reduce ambiguity.
Patch by @Nescio. Differential Revision: D2893