Fixed bugs related to the gevent-socketio upgrade.