Sort names by number

Fixes bug #1369794: if machine names are numbers then sort them as numbers.