Fix type sort