allow nbits = 31 in read_bits