fix bugs with 10 bits