Fix comparisons to numbers and among units of different types