Fix cmp function
Minor