diff --git a/modules/mol/alg/tests/test_ligand_scoring.py b/modules/mol/alg/tests/test_ligand_scoring.py
index 3896aa2fdd9d3a2e85deee047ac1e48ac7b5dc7f..65249c2b54d47af75777d725ce9d7621df203088 100644
--- a/modules/mol/alg/tests/test_ligand_scoring.py
+++ b/modules/mol/alg/tests/test_ligand_scoring.py
@@ -196,8 +196,10 @@ class TestLigandScoring(unittest.TestCase):
         # Test that it works with views and only consider atoms in the view
         # Skip PA, PB and O[1-3]A and O[1-3]B in target and model
         # We assume atom index are fixed and won't change
-        trg_g3d1_sub = trg_g3d1.Select("aindex>6019").residues[0]
-        mdl_g3d_sub = mdl_g3d.Select("aindex>1447").residues[0]
+        trg_g3d1_sub_ent = trg_g3d1.Select("aindex>6019")
+        trg_g3d1_sub = trg_g3d1_sub_ent.residues[0]
+        mdl_g3d_sub_ent = mdl_g3d.Select("aindex>1447")
+        mdl_g3d_sub = mdl_g3d_sub_ent.residues[0]
 
         sym = ligand_scoring._ComputeSymmetries(mdl_g3d_sub, trg_g3d1_sub)
         assert len(sym) == 6