Fixed a bug in the bitset foreach.