lookup table fix and bitcount() fix