This patch also simplifies the code using bit_cnt instead of _bitstr_bits(). This isn't really necessary, but does look cleaner. Bug 6216