Correct sorting of variable codes when numeric

Fixes #11