Fixed assignation of type and metadata type that were reversed