Fix TCP error-catching. We should probably fix this in websocket-protocol instead, maybe.