Fixed bug in calcPDF