Debug code and comments cleanup and fixed missing flagZ in XOR function