Improved peer finding by address
Added null socket check to connect()
Removed old code