Make sure if all buckets removed all the nodes are removed.

Change-Id: I395094fe62bab790265b8264befb5d82443505eb
Adding support for counter

Change-Id: I0b3aaf441d7e28f8ae907da1937743982d239dd0