Fix bugs in AND, OR, XOR, and DAA operation