Fix handling of packets with more than one message