Fix bug in websocket handling.