       is_current? ->
         # We're using the host ERTS, and it is a match for the release ERTS version
         # We just need to make sure the path is up to date
-        for {name, vsn, _dir} = lib <- libs do
-          if is_erts_lib(erts_dir, name) do
-            case get_erts_lib(erts_dir, name, vsn) do
-              false ->
-                Log.error("Invalid RELEASES: Could not find #{name}:#{vsn} in #{erts_dir}")
-
-              real_dir ->
-                {name, vsn, real_dir}
+        fixed_libs =
+          for {name, vsn, _dir} = lib <- libs do
+            if is_erts_lib(erts_dir, name) do
+              case get_erts_lib(erts_dir, name, vsn) do
+                false ->
+                  Log.error("Invalid RELEASES: Could not find #{name}:#{vsn} in #{erts_dir}")
+
+                real_dir ->
+                  {name, vsn, real_dir}
+              end
+            else
+              lib
             end
-          else
-            lib
           end
-        end
+
+        {:release, release, version, erts_vsn, fixed_libs, status}
 
       :else ->
         # We didn't include ERTS, and the host version is not a match

      Log.error("You must pass --release and --version to 'get_code_paths'")
    end

    case select_release(release, version, opts) do
      {:ok, {:release, _, _, _, libs, _}} ->
        for {_name, _ver, dir} <- libs do
          IO.write("-pa \"#{List.to_string(dir)}\"/ebin ")
        end

      {:error, :no_such_release} ->


  # Used to fix invalid paths in RELEASES
  defp fix_release(
         {:release, release, version, erts_vsn, libs, status} = rel,
         root_dir,
         erts_dir
       ) do
