fixed the fillmetadata generator
Merge pull request #171 from RoanKanninga/master

fixed the fillmetadata function