         date_format: "{WDfull}, {D} {Mshort} {YYYY}",
         preview_length: 200}
       |> Poison.encode!(pretty: true, indent: 2)
-    fwrite "#{dir}serum.json", projinfo
-    IO.puts "Generated `#{dir}serum.json`."
+    fname = Path.join dir, "serum.json"
+    fwrite fname, projinfo
+    IO.puts "Generated `#{fname}`."
   end
 
   # Generates a minimal index page for the new project.
   @spec create_index(binary) :: :ok
 
   defp create_index(dir) do
-    fwrite "#{dir}pages/index.md", """
+    fname = Path.join dir, "pages/index.md"
+    fwrite fname, """
     ---
     title: Welcome
     ---
 
     *Hello, world!*
     """
-    IO.puts "Generated `#{dir}pages/pages.json`."
+    IO.puts "Generated `#{fname}`."
   end
 
   # Generates default template files.

        Enum.each mkdir_result, fn {dirname, _} ->
          IO.puts "Created directory `#{dirname}`."
        end
        :ok
      [{dirname, {:error, reason}}|_] ->
        {:error, {reason, dirname, 0}}
    end

    mkdir_result =
      dirs
      |> Enum.map(fn x ->
        dirname = Path.join dir, x
        {dirname, File.mkdir_p(dirname)}
      end)
    case Enum.reject(mkdir_result, fn {_, x} -> x == :ok end) do
