Added better error handling when a packet submission fails.