WebSocket fixes for #1669