sort head after versions, keep other names before, fix #2881