Fixed many socket related issues. Certain edge cases caught for now