Merge upstream changes (tikz support, and bug fixes).