Fix compatability with more recent pip.
Improve PEP8 compliance.