Fixed errors in export to PDF