diff --git a/Makefile b/Makefile
index e01e76bda28ed86c67acc625d0c99c88012a9938..18e6c3b3c0204c8679ccc5457b31a15efa9e3537 100644
--- a/Makefile
+++ b/Makefile
@@ -134,32 +134,31 @@ test: test-lisp test-clean-load test-load-systems doc
 test-load-systems: build/asdf.lisp
 	./test/run-tests.sh -l ${l} ${s}
 
-test-all-lisps:
-	${MAKE} test-load-systems
-	@for lisp in ${lisps} ; do \
-		${MAKE} test-clean-load test-lisp test-upgrade l=$$lisp || exit 1 ; \
-	done
+test-all-lisps: test-load-systems test-all-clean-load test-all-lisp test-all-upgrade
 
-# test upgrade is a very long run... This does just the regression tests
-test-all-no-upgrade:
-	@for lisp in ${lisps} ; do \
-		${MAKE} test-clean-load test-lisp l=$$lisp || exit 1 ; \
-	done
+test-all-clean-load:
+	@for lisp in ${lisps} ; do ${MAKE} test-clean-load l=$$lisp || exit 1 ; done
+
+test-all-lisp:
+	@for lisp in ${lisps} ; do ${MAKE} test-lisp l=$$lisp || exit 1 ; done
 
 test-all-upgrade:
-	@for lisp in ${lisps} ; do \
-		${MAKE} test-upgrade l=$$lisp || exit 1 ; \
-	done
+	@for lisp in ${lisps} ; do ${MAKE} test-upgrade l=$$lisp || exit 1 ; done
+
+test-all-no-upgrade: doc test-load-systems test-all-clean-load test-all-lisp
+
+test-all: test-all-no-upgrade test-all-upgrade
+
+test-all-lisp-no-stop:
+	@for lisp in ${lisps} ; do ${MAKE} test-lisp l=$$lisp ; done ; :
+
+test-all-upgrade-no-stop:
+	@for lisp in ${lisps} ; do ${MAKE} test-upgrade l=$$lisp ; done ; :
 
-test-all: doc test-all-lisps
+test-all-no-upgrade-no-stop: doc test-load-systems test-all-clean-load test-all-lisp-no-stop
 
-test-all-no-stop:
-	-make doc ; for l in ${lisps} ; do \
-	   make test-clean-load test-lisp l=$$l ; make test-upgrade l=$$l ; \
-	done ; true
+test-all-no-stop: test-all-no-upgrade-no-stop test-all-upgrade-no-stop
 
-test-all-no-upgrade-no-stop:
-	-make doc ; for l in ${lisps} ; do make test-clean-load test-lisp l=$$l ; done ; true
 
 extract: extract-all-tagged-asdf
 extract-all-tagged-asdf: build/asdf.lisp
diff --git a/asdf.asd b/asdf.asd
index 58bf23ed03b24d4e70397e7288b5efae656b7ed4..880c25b86c3f2a9f38df3c960f80c6afdd672e46 100644
--- a/asdf.asd
+++ b/asdf.asd
@@ -75,7 +75,7 @@
   :licence "MIT"
   :description "Another System Definition Facility"
   :long-description "ASDF builds Common Lisp software organized into defined systems."
-  :version "3.1.0.34" ;; to be automatically updated by make bump-version
+  :version "3.1.0.36" ;; to be automatically updated by make bump-version
   :depends-on ()
   #+asdf3 :encoding #+asdf3 :utf-8
   :class #.(if (find-class 'package-system nil) 'package-system 'system)
diff --git a/debian/changelog b/debian/changelog
index 17f536f97c9faa6e2384260099289a53c0f00dea..9bb34879e907979879465be55816ecb8a7e5c3f8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,7 +4,7 @@ cl-asdf (2:3.1.1-1) unstable; urgency=low
   * asdf-package-system combines the one-file, one-package, one-system paradigm
     of quick-build and faslpath with the portability and robustness of ASDF 3.
   * Portability: much improved support for the latest GCL 2.8.
-  * Robustness: Fixes and tweaks for ABCL, CLISP, ECL, SBCL/Windows.
+  * Robustness: Fixes and tweaks for ABCL, CLISP, ECL, SBCL/Windows, XCL.
     Test improvements. Added missing dependencies in asdf.asd(!).
     Fixes to version-satisfies (thanks to stassats) and to the file-stamp cache.
   * run-program tweaked again on Windows;
@@ -20,7 +20,7 @@ cl-asdf (2:3.1.1-1) unstable; urgency=low
   * ASDF3.1 feature pushed, to signal the slew of significant improvements
     since initial ASDF 3.0 pre-release (i.e. version 2.27).
 
- -- Francois-Rene Rideau <fare@tunes.org>  Tue, 19 Dec 2013 15:31:56 -0500
+ -- Francois-Rene Rideau <fare@tunes.org>  Tue, 03 Jan 2014 15:10:56 -0500
 
 cl-asdf (2:3.0.3-1) unstable; urgency=low
 
diff --git a/header.lisp b/header.lisp
index 727fcf33048b331c01a4bacbcf3f05154c6e1ea4..e5f976a17129c964a0897c385100a6d82c1e7973 100644
--- a/header.lisp
+++ b/header.lisp
@@ -1,5 +1,5 @@
 ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
-;;; This is ASDF 3.1.0.34: Another System Definition Facility.
+;;; This is ASDF 3.1.0.36: Another System Definition Facility.
 ;;;
 ;;; Feedback, bug reports, and patches are all welcome:
 ;;; please mail to <asdf-devel@common-lisp.net>.
diff --git a/interface.lisp b/interface.lisp
index 2516d452f6a27decf8e257de7afadfff71c4533b..18eca7a4a6d6576fddbe9e8a77b8f29354e8a885 100644
--- a/interface.lisp
+++ b/interface.lisp
@@ -119,6 +119,7 @@
    #:missing-dependency-of-version
    #:circular-dependency        ; errors
    #:duplicate-names #:non-toplevel-system #:non-system-system
+   #:package-system-missing-package-error
 
    #:try-recompiling
    #:retry
diff --git a/package-system.lisp b/package-system.lisp
index 5184ee63e825ff2b2a5f2c969e6405236c7126c7..bca004d2c682992dacd12b175f30920c2daafd6a 100644
--- a/package-system.lisp
+++ b/package-system.lisp
@@ -8,7 +8,7 @@
         :asdf/upgrade :asdf/component :asdf/system :asdf/find-system :asdf/lisp-action)
   (:export
    #:package-system #:register-system-packages #:sysdef-package-system-search
-   #:*defpackage-forms* #:*package-systems*))
+   #:*defpackage-forms* #:*package-systems* #:package-system-missing-package-error))
 (in-package :asdf/package-system)
 
 (with-upgradability ()
@@ -31,15 +31,22 @@
          (member (car form) *defpackage-forms*)))
 
   (defun stream-defpackage-form (stream)
-    (loop :for form = (read stream)
-          :when (defpackage-form-p form)
-            :return form))
+    (loop :for form = (read stream nil nil) :while form
+          :when (defpackage-form-p form) :return form))
 
   (defun file-defpackage-form (file)
     "Return the first DEFPACKAGE form in FILE."
     (with-input-file (f file)
       (stream-defpackage-form f)))
 
+  (define-condition package-system-missing-package-error (system-definition-error)
+    ((system :initarg :system :reader error-system)
+     (pathname :initarg :pathname :reader error-pathname))
+    (:report (lambda (c s)
+               (format s (compatfmt "~@<No package form found while ~
+                                     trying to define package-system ~A from file ~A~>")
+                       (error-system c) (error-pathname c)))))
+
   (defun package-dependencies (defpackage-form)
     "Return a list of packages depended on by the package
 defined in DEFPACKAGE-FORM.  A package is depended upon if
@@ -76,10 +83,10 @@ otherwise return a default system name computed from PACKAGE-NAME."
       system-name
       (string-downcase package-name)))
 
-  (defun package-system-file-dependencies (file)
-    (let* ((defpackage-form (file-defpackage-form file))
-           (package-dependencies (package-dependencies defpackage-form)))
-      (remove t (mapcar 'package-name-system package-dependencies))))
+  (defun package-system-file-dependencies (file &optional system)
+    (if-let (defpackage-form (file-defpackage-form file))
+      (remove t (mapcar 'package-name-system (package-dependencies defpackage-form)))
+      (error 'package-system-missing-package-error :system system :pathname file)))
 
   (defun same-package-system-p (system name directory subpath dependencies)
     (and (eq (type-of system) 'package-system)
@@ -104,7 +111,7 @@ otherwise return a default system name computed from PACKAGE-NAME."
                      (f (probe-file* (subpathname dir sub :type "lisp")
                                      :truename *resolve-symlinks*)))
                 (when (file-pathname-p f)
-                  (let ((dependencies (package-system-file-dependencies f))
+                  (let ((dependencies (package-system-file-dependencies f system))
                         (previous (cdr (system-registered-p system))))
                     (if (same-package-system-p previous system dir sub dependencies)
                         previous
diff --git a/test/asdf-pathname-test.script b/test/asdf-pathname-test.script
index 335a169aaf01e0287c4b7fa2bfb064821b4a586a..bb2a93e3d6b3ceabad3863923719e76cca75cbe5 100644
--- a/test/asdf-pathname-test.script
+++ b/test/asdf-pathname-test.script
@@ -4,7 +4,7 @@
 (in-package :asdf-pathname-test)
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
-  #-xcl (push :asdf-test-logical-pathname *features*)
+  #-(or xcl gcl) (push :asdf-test-logical-pathname *features*)
   #+xcl (push :buggy-untyped-file *features*))
 
 ;;(setf *unspecific-pathname-type* nil)
@@ -423,20 +423,20 @@
 (asdf:initialize-output-translations)
 (format t "output translations: ~S~%" (asdf::output-translations))
 
-(progn
-  ;; we're testing with unix or some emulation, are we not?
-  (assert-pathname-equal (resolve-location '(:home)) (truename (user-homedir-pathname)))
-  (assert-pathname-equal (resolve-location '("/foo" "bar" "baz")) #p"/foo/bar/baz")
-  (assert-pathname-equal (resolve-location '("/foo" "bar" "baz") :ensure-directory t) #p"/foo/bar/baz/")
-  (assert-pathname-equal (resolve-location '("/foo" "bar" "baz") :ensure-directory t :wilden t) (wilden #p"/foo/bar/baz/"))
-  (assert-pathname-equal (resolve-location '("/foo" "bar" "baz") :ensure-directory nil :wilden t) (wilden #p"/foo/bar/"))
-  (assert-pathname-equal (resolve-location '("/foo" "bar" :**/ "baz" #p"*.*") :ensure-directory nil :wilden t) #p"/foo/bar/**/baz/*.*")
+;; we're testing with unix or some emulation, are we not?
 
-  (assert (directory-pathname-p (system-source-directory (find-system :test-asdf/test-source-directory-1))))
-  (assert (directory-pathname-p (system-source-directory (find-system :test-asdf/test-source-directory-2))))
+(assert-pathname-equal (resolve-location '(:home)) (truename (user-homedir-pathname)))
+(assert-pathname-equal (resolve-location '("/foo" "bar" "baz")) #p"/foo/bar/baz")
+(assert-pathname-equal (resolve-location '("/foo" "bar" "baz") :ensure-directory t) #p"/foo/bar/baz/")
+(assert-pathname-equal (resolve-location '("/foo" "bar" "baz") :ensure-directory t :wilden t) (wilden #p"/foo/bar/baz/"))
+(assert-pathname-equal (resolve-location '("/foo" "bar" "baz") :ensure-directory nil :wilden t) (wilden #p"/foo/bar/"))
+(assert-pathname-equal (resolve-location '("/foo" "bar" :**/ "baz" #p"*.*") :ensure-directory nil :wilden t) #p"/foo/bar/**/baz/*.*")
 
-  (or (test-component-pathnames :delete-host t :support-string-pathnames nil)
-      (leave-test "test failed" 1)))
+(assert (directory-pathname-p (system-source-directory (find-system :test-asdf/test-source-directory-1))))
+(assert (directory-pathname-p (system-source-directory (find-system :test-asdf/test-source-directory-2))))
+
+#-gcl
+(assert (test-component-pathnames :delete-host t :support-string-pathnames nil))
 
 #|
 (load "LIBRARY:de;setf;utility;asdf;cp-test.lisp")
diff --git a/test/dll-test.lisp b/test/dll-test.lisp
index 60a6f9884964b482cb56b4c9e50a5d3772aa6c2f..ef251c3ee361664db099eb20d34fa7314ce386e3 100644
--- a/test/dll-test.lisp
+++ b/test/dll-test.lisp
@@ -1,3 +1,5 @@
+(defpackage :test-asdf/dll-test (:use)) ;; dummy, for package-system dependencies.
+
 #+ecl
 (ffi:clines "
 extern int sample_function();
diff --git a/test/dll-user.lisp b/test/dll-user.lisp
index 8e8d033ddcbaf2ee0f3940fb6be17789ce7ac597..a60d529a47a705c97a9e06ec678f04b6da611763 100644
--- a/test/dll-user.lisp
+++ b/test/dll-user.lisp
@@ -1,2 +1,4 @@
+(defpackage :test-asdf/dll-user (:use)) ;; dummy, for package-system dependencies.
+
 (in-package :test-package)
 (ffi:def-function "sample_function" () :returning :int)
diff --git a/test/package-system-test.script b/test/package-system-test.script
index f1f79133c98095198c7da301277e9e9ff8317f68..0b2ebbd03ca0a6af6e29508a79e31be9d3d56891 100644
--- a/test/package-system-test.script
+++ b/test/package-system-test.script
@@ -1,3 +1,8 @@
 (register-directory (subpathname *test-directory* "package-system-test/"))
 (load-system :package-system-test/a/x)
 (load-system :package-system-test/d)
+
+(signals package-system-missing-package-error (load-system :package-system-test/e))
+
+;; No such file.
+(signals missing-component (load-system :package-system-test/f))
diff --git a/test/package-system-test/e.lisp b/test/package-system-test/e.lisp
new file mode 100644
index 0000000000000000000000000000000000000000..98bd74664c250727a589e4958ceca27c3798af7e
--- /dev/null
+++ b/test/package-system-test/e.lisp
@@ -0,0 +1,3 @@
+;; This file is missing a defpackage form, and loading it as a package-system should trigger an error.
+
+(in-package :asdf-test)
diff --git a/test/test-asdf.asd b/test/test-asdf.asd
index 50234fbe8feed17b6b1291e44610a0b49ca542c5..0e9f97b096ae7faeb0dc36696eb86ce3fd8a11a0 100644
--- a/test/test-asdf.asd
+++ b/test/test-asdf.asd
@@ -71,6 +71,3 @@
 (defsystem :test-asdf/bundle-2
   :depends-on (:test-asdf/bundle-1) :components ((:file "file2")))
 
-(defsystem :test-asdf/dll-test :components ((:file "dll-test")))
-
-(defsystem :test-asdf/dll-user :components ((:file "dll-user")))
diff --git a/test/test-compile-file-failure.script b/test/test-compile-file-failure.script
index 368937de562504b4f7c11e43b1daf236788275c0..1cb0e30760f7d0a01eda3ee3af90779945897430 100644
--- a/test/test-compile-file-failure.script
+++ b/test/test-compile-file-failure.script
@@ -4,11 +4,12 @@
   :components ((:file "test-compile-file-failure")))
 
 (assert (handler-case
-            (let ((*compile-file-failure-behaviour* :warn))
-              (load-system 'test-compile-file-failure :force t)
-              t)
+	    (let ((*compile-file-failure-behaviour* :warn))
+	      (load-system 'test-compile-file-failure :force t)
+	      t)
           (compile-file-error () nil)))
 
+#-gcl
 (assert (handler-case
             (let ((*compile-file-failure-behaviour* :error))
               (load-system 'test-compile-file-failure :force t)
diff --git a/test/test-logical-pathname.script b/test/test-logical-pathname.script
index b67c572cf2f120ad2cdd242d44b127bc2e0f2176..897877aeffb1afc9fc80d17af4b414414c6abf7a 100644
--- a/test/test-logical-pathname.script
+++ b/test/test-logical-pathname.script
@@ -17,7 +17,7 @@
      (translate-logical-pathname "ASDF:test;test-logical-pathname.asd")
      (truename "ASDF:test;test-logical-pathname.asd"))
 
-#+xcl (leave-test "GCL 2.6 doesn't do Logical pathnames well enough" 0)
+#+(or gcl xcl) (leave-test "This implementation doesn't do Logical pathnames well enough" 0)
 
 (DBG "Test logical pathnames in central registry")
 (setf *central-registry* '(#p"ASDF:test;"))
diff --git a/uiop/os.lisp b/uiop/os.lisp
index b97242bd0c22b3f19009ed99e97a9131e02781ba..0de9bd34103eb260c509056e12011befb7bbb3ba 100644
--- a/uiop/os.lisp
+++ b/uiop/os.lisp
@@ -267,7 +267,7 @@ suitable for use as a directory name to segregate Lisp FASLs, C dynamic librarie
   (defun chdir (x)
     "Change current directory, as per POSIX chdir(2), to a given pathname object"
     (if-let (x (pathname x))
-      (or #+abcl (java:jstatic "setProperty" "java.lang.System" "user.dir" (native-namestring x))
+      (or #+abcl (java:jstatic "setProperty" "java.lang.System" "user.dir" (namestring x))
           #+allegro (excl:chdir x)
           #+clisp (ext:cd x)
           #+clozure (setf (ccl:current-directory) x)
diff --git a/upgrade.lisp b/upgrade.lisp
index 36b02f626d8ca8dbe6f810c6ad4d4a906df7252f..a2a61cf31ab47c824342b0150365937656c8c38b 100644
--- a/upgrade.lisp
+++ b/upgrade.lisp
@@ -64,7 +64,7 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO
          ;; "3.4.5.67" would be a development version in the official branch, on top of 3.4.5.
          ;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5
          ;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67
-         (asdf-version "3.1.0.34")
+         (asdf-version "3.1.0.36")
          (existing-version (asdf-version)))
     (setf *asdf-version* asdf-version)
     (when (and existing-version (not (equal asdf-version existing-version)))
diff --git a/version.lisp-expr b/version.lisp-expr
index e2723142b8c42c4a4e95b4fd740aa664d6bd1ea1..e89b29f6c2c86e2f30f5f169187766001e86301d 100644
--- a/version.lisp-expr
+++ b/version.lisp-expr
@@ -1,2 +1,2 @@
-"3.1.0.34"
+"3.1.0.36"