Some minor changes to tex, not finished yet