fix #3061: name sorting wrong for certain number combinations