Fixed some counting issues
Merge pull request #190 from einfallstoll/patch-1

Fixed some counting issues