AndGate, OrGate, XorGate fix