           ]
           |> Enum.reject(&is_nil/1)
           |> Enum.map(&Map.fetch!(&1, "linux_version"))
-          |> Enum.sort_by(&normalize_version/1, :desc)
+          |> Enum.sort_by(&normalize_version/1, {:desc, Version})
           |> List.first()
 
         _ ->

          values = [
            version,
            data.otp_version,
            data.nerves_system_br_version,
            data.buildroot_version,
            data.linux_version

        for version <- versions do
          put(
            {target, version, :nerves_system_br_version},
            Repo.get_nerves_system_br_version_for_target(target, version)
          )

          put(
            {target, version, :nerves_version},
            Repo.get_nerves_version_for_target(target, version)
          )

          put(
