Added better handling for invalid packages in message.