Fix flipped coordinate system