Bug fix on export to PDF