           initial_version = make_version_struct(%{event: "insert"}, changeset_data, options)
           repo.insert(initial_version)
         end)
-        |> Ecto.Multi.run(model_key, fn repo, %{initial_version: initial_version} ->
+        |> Ecto.Multi.run(model_key, fn repo, %{^initial_version_key => initial_version} ->
           updated_changeset =
             changeset
             |> change(%{

          repo.insert(updated_changeset, ecto_options)
        end)
        |> Ecto.Multi.run(version_key, fn repo,
                                          %{:initial_version => initial_version, ^model_key => model} ->
          target_version = make_version_struct(%{event: "insert"}, model, options) |> serialize()

          Version.changeset(initial_version, target_version) |> repo.update

          prefix: nil,
          model_key: :model,
          version_key: :version,
          initial_version_key: :initial_version,
          ecto_options: []
        ]
      ) do
    model_key = options[:model_key] || :model
    version_key = options[:version_key] || :version
    initial_version_key = options[:initial_version_key] || :initial_version
    ecto_options = options[:ecto_options] || []

    case RepoClient.strict_mode() do
      true ->
        multi
        |> Ecto.Multi.run(initial_version_key, fn repo, %{} ->
          version_id = get_sequence_id("versions") + 1

          changeset_data =
