MetaData parsing, fix cleanup