Fix issue with unsorted textvar keys