mixed fixes, made the pdf generation optional