Fixed type of cmp function used in sorting