Socket.io support and fixes.