Fixed a bug when parsing metadata