Improve formatting of socket_closed messages