Fixing some counting