pep8 and other minor fixes; added script to spec file