Improve type comparisons