fixed an overflow issue in unpack_k_bits::unpack

having j as an unsigned int causes an overflow, most likely causing a segfault