Fixed the wrong assignations to type, metadataType.

Fixed the wrong assignations to type, metadataType.