Fix sometimes getting kicked from server because of illegal characters in chat.