Sort versions correctly