Fix XY transformation equations