Move numerical sort earlier in the pipeline

Correcting the previous patch, which added numerical sort at the end of the pipeline in stead of modifying the existing sort. Furthermore, `-n` is substituted for `-g`, since we are [dealing with integers](http://stackoverflow.com/questions/1255782/whats-the-difference-between-general-numeric-sort-and-numeric-sort-options).