Issue #7792 made `x < I` different from `I < x`: fix and add tests