Fix bug about importing socket.