Fix raw message sending, and responding to heartbeats.