diff --git a/opensafely/jupyter.py b/opensafely/jupyter.py
index 4970d47..4277b4f 100644
--- a/opensafely/jupyter.py
+++ b/opensafely/jupyter.py
@@ -36,7 +36,7 @@ def add_arguments(parser):
         "--port",
         "-p",
         default=None,
-        help="Port to run on",
+        help="Port to run on (random by default)",
     )
     parser.add_argument(
         "jupyter_args",
@@ -76,9 +76,6 @@ def main(directory, name, port, no_browser, jupyter_args):
         name = f"os-jupyter-{directory.name}"
 
     if port is None:
-        # this is a race condition, as something else could consume the socket
-        # before docker binds to it, but the chance of that on a user's
-        # personal machine is very small.
         port = str(utils.get_free_port())
 
     jupyter_cmd = [
diff --git a/opensafely/rstudio.py b/opensafely/rstudio.py
index 9096bd8..2b5440a 100644
--- a/opensafely/rstudio.py
+++ b/opensafely/rstudio.py
@@ -19,12 +19,11 @@ def add_arguments(parser):
     parser.add_argument(
         "--name", help="Name of docker image (defaults to use directory name)"
     )
-
     parser.add_argument(
         "--port",
         "-p",
         default=None,
-        help="Port to run on",
+        help="Port to run on (random by default)",
     )
 
 
@@ -37,8 +36,6 @@ def main(directory, name, port):
 
     url = f"http://localhost:{port}"
 
-    # Determine if on Linux, if so obtain user id
-    # And need to know in Windows win32 for text file line endings setting
     if platform == "linux":
         uid = os.getuid()
     else:
@@ -57,14 +54,19 @@ def main(directory, name, port):
 
     utils.debug("docker: " + " ".join(docker_args))
     print(
-        f"Opening an RStudio Server session at http://localhost:{port}/ when "
-        "you are finished working please press Ctrl+C here to end the session"
+        f"Opening an RStudio Server session at {url}. "
+        "When you are finished working please press Ctrl+C here to end the session"
     )
 
     utils.open_browser_in_thread(url)
 
     ps = utils.run_docker(
-        docker_args, "rstudio", "", interactive=True, user="0:0", directory=directory
+        docker_args,
+        image="rstudio",
+        interactive=True,
+        # rstudio needs to start as root, but drops privileges to uid later
+        user="0:0",
+        directory=directory,
     )
 
     # we want to exit with the same code that rstudio-server did
diff --git a/opensafely/utils.py b/opensafely/utils.py
index e6752aa..271886f 100644
--- a/opensafely/utils.py
+++ b/opensafely/utils.py
@@ -92,7 +92,7 @@ def git_bash_tty_wrapper():
 def run_docker(
     docker_args,
     image,
-    cmd,
+    cmd=(),
     directory=None,
     interactive=False,
     user=None,