Bugfixes + new file to generate metadata.