More robust check of empty packets.