fixing infinite loop

Fixes infinite loop on messy version names: e.g VersionSorter.sort ["1.0", "-"]