Fix a crash when multiple metadata packets are present.