Fix crash for "qpdf" generated file and misc. PEP8 fixes