diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 2825c99..f05b5cb 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -926,7 +926,7 @@ class ModelAdmin(BaseModelAdmin):
             for FormSet, inline in zip(self.get_formsets(request), self.inline_instances):
                 prefix = FormSet.get_default_prefix()
                 prefixes[prefix] = prefixes.get(prefix, 0) + 1
-                if prefixes[prefix] != 1:
+                if prefixes[prefix] != 1 or not prefix:
                     prefix = "%s-%s" % (prefix, prefixes[prefix])
                 formset = FormSet(data=request.POST, files=request.FILES,
                                   instance=new_object,
@@ -955,7 +955,7 @@ class ModelAdmin(BaseModelAdmin):
                                        self.inline_instances):
                 prefix = FormSet.get_default_prefix()
                 prefixes[prefix] = prefixes.get(prefix, 0) + 1
-                if prefixes[prefix] != 1:
+                if prefixes[prefix] != 1 or not prefix:
                     prefix = "%s-%s" % (prefix, prefixes[prefix])
                 formset = FormSet(instance=self.model(), prefix=prefix,
                                   queryset=inline.queryset(request))
@@ -1025,7 +1025,7 @@ class ModelAdmin(BaseModelAdmin):
                                        self.inline_instances):
                 prefix = FormSet.get_default_prefix()
                 prefixes[prefix] = prefixes.get(prefix, 0) + 1
-                if prefixes[prefix] != 1:
+                if prefixes[prefix] != 1 or not prefix:
                     prefix = "%s-%s" % (prefix, prefixes[prefix])
                 formset = FormSet(request.POST, request.FILES,
                                   instance=new_object, prefix=prefix,
@@ -1046,7 +1046,7 @@ class ModelAdmin(BaseModelAdmin):
             for FormSet, inline in zip(self.get_formsets(request, obj), self.inline_instances):
                 prefix = FormSet.get_default_prefix()
                 prefixes[prefix] = prefixes.get(prefix, 0) + 1
-                if prefixes[prefix] != 1:
+                if prefixes[prefix] != 1 or not prefix:
                     prefix = "%s-%s" % (prefix, prefixes[prefix])
                 formset = FormSet(instance=obj, prefix=prefix,
                                   queryset=inline.queryset(request))
diff --git a/tests/regressiontests/admin_inlines/admin.py b/tests/regressiontests/admin_inlines/admin.py
index 6f8076a..4edd361 100644
--- a/tests/regressiontests/admin_inlines/admin.py
+++ b/tests/regressiontests/admin_inlines/admin.py
@@ -101,6 +101,14 @@ class NovelAdmin(admin.ModelAdmin):
     inlines = [ChapterInline]
 
 
+class ConsigliereInline(admin.TabularInline):
+    model = Consigliere
+
+
+class SottoCapoInline(admin.TabularInline):
+    model = SottoCapo
+
+
 site.register(TitleCollection, inlines=[TitleInline])
 # Test bug #12561 and #12778
 # only ModelAdmin media
@@ -115,3 +123,4 @@ site.register(Novel, NovelAdmin)
 site.register(Fashionista, inlines=[InlineWeakness])
 site.register(Holder4, Holder4Admin)
 site.register(Author, AuthorAdmin)
+site.register(CapoFamiglia, inlines=[ConsigliereInline, SottoCapoInline])
diff --git a/tests/regressiontests/admin_inlines/models.py b/tests/regressiontests/admin_inlines/models.py
index f4e58f2..748280d 100644
--- a/tests/regressiontests/admin_inlines/models.py
+++ b/tests/regressiontests/admin_inlines/models.py
@@ -122,3 +122,17 @@ class Novel(models.Model):
 class Chapter(models.Model):
     novel = models.ForeignKey(Novel)
 
+
+# Models for #16838
+class CapoFamiglia(models.Model):
+    name = models.CharField(max_length=100)
+
+
+class Consigliere(models.Model):
+    name = models.CharField(max_length=100)
+    capo_famiglia = models.ForeignKey(CapoFamiglia, related_name='+')
+
+
+class SottoCapo(models.Model):
+    name = models.CharField(max_length=100)
+    capo_famiglia = models.ForeignKey(CapoFamiglia, related_name='+')
diff --git a/tests/regressiontests/admin_inlines/tests.py b/tests/regressiontests/admin_inlines/tests.py
index efa6cf6..955d620 100644
--- a/tests/regressiontests/admin_inlines/tests.py
+++ b/tests/regressiontests/admin_inlines/tests.py
@@ -4,7 +4,8 @@ from django.test import TestCase
 
 # local test models
 from models import (Holder, Inner, Holder2, Inner2, Holder3,
-    Inner3, Person, OutfitItem, Fashionista, Teacher, Parent, Child)
+    Inner3, Person, OutfitItem, Fashionista, Teacher, Parent, Child,
+    CapoFamiglia, Consigliere, SottoCapo)
 from admin import InnerInline
 
 
@@ -115,6 +116,32 @@ class TestInline(TestCase):
         self.assertContains(response, '<p class="help">Awesome stacked help text is awesome.</p>', 4)
         self.assertContains(response, '<img src="/static/admin/img/icon-unknown.gif" class="help help-tooltip" width="10" height="10" alt="(Awesome tabular help text is awesome.)" title="Awesome tabular help text is awesome." />', 1)
 
+    def test_non_related_name_inline(self):
+        """
+        Ensure that multiple inlines with related_name='+' have correct form
+        prefixes. Bug #16838.
+        """
+        response = self.client.get('/admin/admin_inlines/capofamiglia/add/')
+
+        self.assertContains(response,
+                '<input type="hidden" name="-1-0-id" id="id_-1-0-id" />')
+        self.assertContains(response,
+                '<input type="hidden" name="-1-0-capo_famiglia" '
+                'id="id_-1-0-capo_famiglia" />')
+        self.assertContains(response,
+                '<input id="id_-1-0-name" type="text" class="vTextField" '
+                'name="-1-0-name" maxlength="100" />')
+
+        self.assertContains(response,
+                '<input type="hidden" name="-2-0-id" id="id_-2-0-id" />')
+        self.assertContains(response,
+                '<input type="hidden" name="-2-0-capo_famiglia" '
+                'id="id_-2-0-capo_famiglia" />')
+        self.assertContains(response,
+                '<input id="id_-2-0-name" type="text" class="vTextField" '
+                'name="-2-0-name" maxlength="100" />')
+
+
 class TestInlineMedia(TestCase):
     urls = "regressiontests.admin_inlines.urls"
     fixtures = ['admin-views-users.xml']
