diff --git a/asdf.lisp b/asdf.lisp
index f1f6d7c4aa277786763b7895175f2cc33ce0b519..a32e0ecd772f0831c7f91f36d5014e9d70aef6e6 100644
--- a/asdf.lisp
+++ b/asdf.lisp
@@ -1359,9 +1359,9 @@ Returns the new tree (which probably shares structure with the old one)"
   (loop for name in +asdf-methods+ do
        (let ((keyword (intern (symbol-name name) :keyword)))
 	 (loop for data = rest then (cddr data)
-	      while data
-	      for key = (first data) 
-	      for value = (second data) 
+	      for key = (and data (first data))
+	      for value = (and data (second data))
+              while data
 	      when (eq key keyword) do
 	      (destructuring-bind (op qual (o c) &body body) value
 	      (pushnew