fix bugs from invalid bit xor to not_and
remove some garbage