Is this custom Eq/Hash impl "correct"?