Fix a bug of next_bits