diff --git a/uiop/stream.lisp b/uiop/stream.lisp
index 1590b71c4cc3927544e50b65c807bd336d597468..bd0f8c318ca98b0f17394caf89d1d35880b95100 100644
--- a/uiop/stream.lisp
+++ b/uiop/stream.lisp
@@ -627,7 +627,7 @@ Upon success, the KEEP form is evaluated and the file is is deleted unless it ev
     (check-type pathname symbol)
     (assert (or streamp pathnamep))
     (let* ((afterp (position :close-stream body))
-           (before (if afterp (subseq body 0 (1- afterp)) body))
+           (before (if afterp (subseq body 0 afterp) body))
            (after (when afterp (subseq body (1+ afterp))))
            (beforef (gensym "BEFORE"))
            (afterf (gensym "AFTER")))
@@ -647,7 +647,7 @@ Upon success, the KEEP form is evaluated and the file is is deleted unless it ev
           ,@(when suffix `(:suffix ,suffix))
           ,@(when type `(:type ,type))
           ,@(when keep `(:keep ,keep))
-          ,@(when after `(:after `#',afterf))
+          ,@(when after `(:after #',afterf))
           ,@(when element-type `(:element-type ,element-type))
           ,@(when external-format `(:external-format ,external-format))))))