Fix comparisons of derived tags (bug 6239).