Make generator more robust against unexpected metadata.