diff --git a/modules/mol/alg/pymod/ligand_scoring.py b/modules/mol/alg/pymod/ligand_scoring.py
index 5b0a87da71b5c6901cd19da191b555f882609f42..29897cfc1669ed588e2e4b300576555765abb9fc 100644
--- a/modules/mol/alg/pymod/ligand_scoring.py
+++ b/modules/mol/alg/pymod/ligand_scoring.py
@@ -854,7 +854,7 @@ class LigandScorer:
                 if np.any(alternative_matches):
                     # Get the scores of these matches
                     LogVerbose("Found match with lower coverage but better score")
-                    min_mat1 = np.min(mat1[alternative_matches])
+                    min_mat1 = np.nanmin(mat1[alternative_matches])
                     max_i_trg, max_i_mdl = _get_best_match(min_mat1, min_coverage - coverage_delta)
 
                 # Disable row and column