Fixes to metadata parser