Fixed the PDF writer