Hack for counting the message length.