Fixed bug in drawing PDFs