make comparison chains maximally short-circuiting. fixes #2467