Fixes #623
 fixes small typo in counting