Several fixes to preserve compatibility with Xflip.