Index: src/import-export/qif-import/qif-to-gnc.scm
===================================================================
--- src/import-export/qif-import/qif-to-gnc.scm	(revision 16932)
+++ src/import-export/qif-import/qif-to-gnc.scm	(working copy)
@@ -176,6 +176,9 @@
                                qif-acct-map qif-cat-map 
                                qif-memo-map stock-map 
                                default-currency-name window)
+  (let ((progress-dialog '())
+        (retval #f))
+    (set! retval
   (gnc:backtrace-if-exception 
    (lambda ()
      (let* ((old-root (gnc-get-current-root-account))
@@ -193,7 +196,6 @@
                    (lambda (a b)
                      (> (length (qif-file:xtns a)) 
                         (length (qif-file:xtns b))))))
-            (progress-dialog '())
             (work-to-do 0)
             (work-done 0))
        
@@ -264,7 +266,8 @@
 
             (cond ((and equity? security)  ;; a "retained holdings" acct
                    (qif-import:find-or-make-acct acctinfo #f
-                                                 security #t default-currency
+                                                     security #t
+                                                     default-currency
                                                  gnc-acct-hash 
                                                  old-root new-root))
                   ((and security (or stock?
@@ -339,8 +342,7 @@
                      (xaccTransBeginEdit gnc-xtn)
 
                      ;; FIXME. This is probably wrong
-                     (xaccTransSetCurrency gnc-xtn
-                                                   (gnc-default-currency))
+                         (xaccTransSetCurrency gnc-xtn (gnc-default-currency))
 
                      ;; build the transaction
                      (qif-import:qif-xtn-to-gnc-xtn 
@@ -352,12 +354,15 @@
            (qif-file:xtns qif-file)))
         sorted-qif-files-list)
        
-       ;; get rid of the progress dialog 
+           new-root))))
+
+    ;; Get rid of the progress dialog (if any).
        (if (not (null? progress-dialog))
            (gnc-progress-dialog-destroy progress-dialog))
        
-       new-root))))
+    retval))
 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; qif-import:qif-xtn-to-gnc-xtn
 ;; translate a single transaction to a set of gnucash splits and 
