Fix class sorting in ClassMap