diff --git a/substrate/frame/parameters/src/tests/mock.rs b/substrate/frame/parameters/src/tests/mock.rs
index 53a3b3e394c4b7c5d8410ba6e1af758d78cbf8ae..8d6f7d25ceac5e02ee4a067d77e4b8a5f88c1599 100644
--- a/substrate/frame/parameters/src/tests/mock.rs
+++ b/substrate/frame/parameters/src/tests/mock.rs
@@ -75,7 +75,7 @@ pub mod dynamic_params {
 	}
 
 	#[dynamic_pallet_params]
-	#[codec(index = 3)]
+	#[codec(index = 4)]
 	pub mod somE_weird_SPElLInG_s {
 		#[codec(index = 0)]
 		pub static V: u64 = 0;
diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/origin.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/origin.rs
index 4742e68e2e2a8d86c14a27e038868e25892557e0..aada9f7af75b73a0d4b8166e0cbb47f899f8045e 100644
--- a/substrate/frame/support/procedural/src/construct_runtime/expand/origin.rs
+++ b/substrate/frame/support/procedural/src/construct_runtime/expand/origin.rs
@@ -209,6 +209,7 @@ pub fn expand_outer_origin(
 			system(#system_path::Origin<#runtime>),
 			#caller_variants
 			#[allow(dead_code)]
+			#[codec(skip)]
 			Void(#scrate::__private::Void)
 		}
 
diff --git a/substrate/frame/support/test/tests/enum_deprecation.rs b/substrate/frame/support/test/tests/enum_deprecation.rs
index c1167dfe339ce0a013c0d9e7cb742a8161ddab75..72b14dad962917ce0ea0fe21530aaa66cf769bb7 100644
--- a/substrate/frame/support/test/tests/enum_deprecation.rs
+++ b/substrate/frame/support/test/tests/enum_deprecation.rs
@@ -85,6 +85,7 @@ pub mod pallet {
 		T::AccountId: SomeAssociation1 + From<SomeType1>,
 	{
 		#[deprecated = "second"]
+		#[codec(index = 1)]
 		A,
 		#[deprecated = "first"]
 		#[codec(index = 0)]
@@ -157,20 +158,13 @@ fn pallet_metadata() {
 		// Example pallet events are partially and fully deprecated
 		let meta = example.event.unwrap();
 		assert_eq!(
-			// Result should be this, but instead we get the result below
-			// see: https://github.com/paritytech/parity-scale-codec/issues/507
-			//
-			// DeprecationInfoIR::VariantsDeprecated(BTreeMap::from([
-			// 	(codec::Compact(0), DeprecationStatusIR::Deprecated { note: "first", since: None
-			// }), 	(
-			// 		codec::Compact(1),
-			// 		DeprecationStatusIR::Deprecated { note: "second", since: None }
-			// 	)
-			// ])),
-			DeprecationInfoIR::VariantsDeprecated(BTreeMap::from([(
-				codec::Compact(0),
-				DeprecationStatusIR::Deprecated { note: "first", since: None }
-			),])),
+			DeprecationInfoIR::VariantsDeprecated(BTreeMap::from([
+				(codec::Compact(0), DeprecationStatusIR::Deprecated { note: "first", since: None }),
+				(
+					codec::Compact(1),
+					DeprecationStatusIR::Deprecated { note: "second", since: None }
+				)
+			])),
 			meta.deprecation_info
 		);
 	}