Fixed some bugs XOR