Fix x/y order (it was reversed in tgen)