Fix flipped variables