Trap any WebSocketError exceptions
Don't write messages if there are none.
Vertical whitespace cleanup