Fix Bug 1027351 - Fix a massive derp in the script sort generator