Fix parsing of messages from bytestream.