Fix bug: perform promotions before comparisons.