TASK-8: Properly clean up sockets, no more duplicate sockets