Fix problems with PDF export.