The way you implemented badges if you reset the badge value during a
page session it stacks the values on top of each other. Now if you use
false to turn it off it only turns off the last value.
Here is the fiddle and steps to repo:
Step 1: Click "Set Count to 5"
Step 2: Click "Set Count to 10"
Step 3: Click "Set count to 0 Enhanced"
PS Using the latest version at the time: