Fix on metadata matching and handling