Fix Variables sort.

This fixes the sort interface on `Variables` which affects the Lua codegen.