diff --git a/routingtable/adjRIBOut/path_id_manager.go b/routingtable/adjRIBOut/path_id_manager.go
index 377ce9b3057101b6c1561d0124d9802f83c74faf..b13c66745c8d0e9f13bb3944aaa01d4560296780 100644
--- a/routingtable/adjRIBOut/path_id_manager.go
+++ b/routingtable/adjRIBOut/path_id_manager.go
@@ -61,6 +61,7 @@ func (fm *pathIDManager) releasePath(p *route.Path) (uint32, error) {
 		delete(fm.ids, fm.idByPath[*p.BGPPath])
 		delete(fm.idByPath, *p.BGPPath)
 	}
+	fm.used--
 
 	return id, nil
 }
diff --git a/routingtable/adjRIBOut/path_id_manager_test.go b/routingtable/adjRIBOut/path_id_manager_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..9f3ca112f43a18df58cd3e4a38da9241a3625fa5
--- /dev/null
+++ b/routingtable/adjRIBOut/path_id_manager_test.go
@@ -0,0 +1,231 @@
+package adjRIBOut
+
+import (
+	"testing"
+
+	"github.com/bio-routing/bio-rd/route"
+	"github.com/stretchr/testify/assert"
+)
+
+func TestAddPath(t *testing.T) {
+	tests := []struct {
+		name     string
+		maxIDs   uint32
+		count    int
+		wantFail bool
+	}{
+		{
+			name:     "Out of path IDs",
+			maxIDs:   10,
+			count:    11,
+			wantFail: true,
+		},
+		{
+			name:     "Success",
+			maxIDs:   10,
+			count:    10,
+			wantFail: false,
+		},
+	}
+
+X:
+	for _, test := range tests {
+		maxUint32 = test.maxIDs
+		m := newPathIDManager()
+		for i := 0; i < test.count; i++ {
+			_, err := m.addPath(&route.Path{BGPPath: &route.BGPPath{LocalPref: uint32(i)}})
+			if err != nil {
+				if test.wantFail {
+					continue X
+				}
+
+				t.Errorf("Unexpected failure for test %q: %v", test.name, err)
+				continue X
+			}
+		}
+
+		if test.wantFail {
+			t.Errorf("Unexpected success for test %q", test.name)
+			continue
+		}
+	}
+
+}
+
+func TestReleasePath(t *testing.T) {
+	tests := []struct {
+		name     string
+		pm       *pathIDManager
+		release  *route.Path
+		expected *pathIDManager
+		wantFail bool
+	}{
+		{
+			name: "Release existent",
+			pm: &pathIDManager{
+				ids: map[uint32]uint64{
+					0: 1,
+					1: 1,
+					2: 1,
+				},
+				idByPath: map[route.BGPPath]uint32{
+					route.BGPPath{
+						LocalPref: 0,
+					}: 0,
+					route.BGPPath{
+						LocalPref: 1,
+					}: 1,
+					route.BGPPath{
+						LocalPref: 2,
+					}: 2,
+				},
+				last: 2,
+				used: 3,
+			},
+			release: &route.Path{BGPPath: &route.BGPPath{
+				LocalPref: 2,
+			}},
+			expected: &pathIDManager{
+				ids: map[uint32]uint64{
+					0: 1,
+					1: 1,
+				},
+				idByPath: map[route.BGPPath]uint32{
+					route.BGPPath{
+						LocalPref: 0,
+					}: 0,
+					route.BGPPath{
+						LocalPref: 1,
+					}: 1,
+				},
+				last: 2,
+				used: 2,
+			},
+		},
+		{
+			name: "Release non-existent",
+			pm: &pathIDManager{
+				ids: map[uint32]uint64{
+					0: 1,
+					1: 1,
+					2: 1,
+				},
+				idByPath: map[route.BGPPath]uint32{
+					route.BGPPath{
+						LocalPref: 0,
+					}: 0,
+					route.BGPPath{
+						LocalPref: 1,
+					}: 1,
+					route.BGPPath{
+						LocalPref: 2,
+					}: 2,
+				},
+				last: 2,
+				used: 3,
+			},
+			release: &route.Path{BGPPath: &route.BGPPath{
+				LocalPref: 4,
+			}},
+			expected: &pathIDManager{
+				ids: map[uint32]uint64{
+					0: 1,
+					1: 1,
+					2: 1,
+				},
+				idByPath: map[route.BGPPath]uint32{
+					route.BGPPath{
+						LocalPref: 0,
+					}: 0,
+					route.BGPPath{
+						LocalPref: 1,
+					}: 1,
+					route.BGPPath{
+						LocalPref: 2,
+					}: 2,
+				},
+				last: 2,
+				used: 3,
+			},
+			wantFail: true,
+		},
+	}
+
+	for _, test := range tests {
+		_, err := test.pm.releasePath(test.release)
+		if err != nil {
+			if test.wantFail {
+				continue
+			}
+
+			t.Errorf("Unexpected failure for test %q: %v", test.name, err)
+			continue
+		}
+
+		if test.wantFail {
+			t.Errorf("Unexpected success for test %q", test.name)
+			continue
+		}
+
+		assert.Equalf(t, test.expected, test.pm, "%s", test.name)
+	}
+}
+
+/*func TestReleaseID(t *testing.T) {
+	tests := []struct {
+		name     string
+		pm       *pathIDManager
+		release  uint32
+		expected *pathIDManager
+	}{
+		{
+			name: "Release existent",
+			pm: &pathIDManager{
+				ids: map[uint32]struct{}{
+					0: struct{}{},
+					1: struct{}{},
+					2: struct{}{},
+				},
+				last: 2,
+				used: 3,
+			},
+			release: 1,
+			expected: &pathIDManager{
+				ids: map[uint32]struct{}{
+					0: struct{}{},
+					2: struct{}{},
+				},
+				last: 2,
+				used: 2,
+			},
+		},
+		{
+			name: "Release non-existent",
+			pm: &pathIDManager{
+				ids: map[uint32]struct{}{
+					0: struct{}{},
+					1: struct{}{},
+					2: struct{}{},
+				},
+				last: 2,
+				used: 3,
+			},
+			release: 3,
+			expected: &pathIDManager{
+				ids: map[uint32]struct{}{
+					0: struct{}{},
+					1: struct{}{},
+					2: struct{}{},
+				},
+				last: 2,
+				used: 3,
+			},
+		},
+	}
+
+	for _, test := range tests {
+		test.pm.releaseID(test.release)
+		assert.Equalf(t, test.expected, test.pm, "%s", test.name)
+	}
+}
+*/