Fixed AMI sorting