Merge change 23669 into eclair

* changes:
  Cleaner way to fix the -1 count problem (and removing an Eclipse warning along the way).