Incorrect equality test on connection