Fix duplicate socket bug.