Fixing a double counting bug