diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp
index e89340da2c683e8fbc4b9b3a2d86f34699e6e1c6..4dd461bc01f2b96f028a4c4225a14c5ae2b066ef 100644
--- a/source/Lib/DecoderLib/DecCu.cpp
+++ b/source/Lib/DecoderLib/DecCu.cpp
@@ -2189,7 +2189,14 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
           pu.mmvdMergeIdx
         );
 #if JVET_AB0079_TM_BCW_MRG
-        m_pcInterPred->adjustMergeCandidatesBcwIdx(pu, mrgCtx, fPosBaseIdx);
+        if (pu.cs->sps->getUseAML()
+#if JVET_AE0174_NONINTER_TM_TOOLS_CONTROL
+          && pu.cs->sps->getTMToolsEnableFlag()
+#endif
+          )
+        {
+          m_pcInterPred->adjustMergeCandidatesBcwIdx(pu, mrgCtx, fPosBaseIdx);
+        }
 #endif
 #if JVET_Y0067_ENHANCED_MMVD_MVD_SIGN_PRED
         uint32_t mmvdLUT[MMVD_ADD_NUM];
diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index 618e324e061a9e0476ccc11121fdf6d37b8a32ff..d6cf302049b27691053752758043cd9ab8ffae30 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -3908,7 +3908,14 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
       mrgCtxCiip.candCost[uiMergeCand] = mergeCtx.candCost[uiMergeCand];
     }
     
-    m_pcInterSearch->adjustMergeCandidatesBcwIdx(pu, mergeCtx);
+    if (sps.getUseAML()
+#if JVET_AE0174_NONINTER_TM_TOOLS_CONTROL
+      && sps.getTMToolsEnableFlag()
+#endif
+      )
+    {
+      m_pcInterSearch->adjustMergeCandidatesBcwIdx(pu, mergeCtx);
+    }
 #endif
     PU::getInterMergeCandidates(pu, mergeCtxtmp, 0);
 #endif
@@ -4047,7 +4054,14 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
     bool flag = pu.mmvdMergeFlag;
     pu.mmvdMergeFlag = true;
 #if JVET_AB0079_TM_BCW_MRG
-    m_pcInterSearch->adjustMergeCandidatesBcwIdx(pu, mergeCtxtmp);
+    if (sps.getUseAML()
+#if JVET_AE0174_NONINTER_TM_TOOLS_CONTROL
+      && sps.getTMToolsEnableFlag()
+#endif
+      )
+    {
+      m_pcInterSearch->adjustMergeCandidatesBcwIdx(pu, mergeCtxtmp);
+    }
 #endif
     m_pcInterSearch->sortInterMergeMMVDCandidates(pu, mergeCtxtmp, mmvdLUT);
     pu.mmvdMergeFlag = flag;