Removed unused imports.
Fixed socket bug found by capi_x