XOR returned reversed result than I expected