more useful error message when comparing ranges with non-ranges