Fix metadata lookup in rets script

Fix namespace when looking for METADATA_TYPES
Add metadata_types to metadata lookup