Fix bug with peer lookup if peer socket creation failed.