Fixed magic cmp logic