diff --git a/motif/lisp/internals.lisp b/motif/lisp/internals.lisp
index 73aaf1dedd73399f1464e9c690308c8cac16e678..800595044209672e55f0f876189b2e8dcac8f97d 100644
--- a/motif/lisp/internals.lisp
+++ b/motif/lisp/internals.lisp
@@ -67,8 +67,8 @@
 	  (handler-case
 	      (ext::connect-to-unix-socket
 	       (if pid
-		   (format nil "/tmp/.motif_socket-p~a" pid)
-		   (format nil "/tmp/.motif_socket-u~a" (unix:unix-getuid))))
+		   (format nil "/tmp/.motif_socket-p~D" pid)
+		   (format nil "/tmp/.motif_socket-u~D" (unix:unix-getuid))))
 	    (error ()
 	      (ext:connect-to-unix-socket "/tmp/.motif_socket"))))
     (error ()