Fix bizzare type comparisons