Fixed G++ uninitialized counter bug