Fix pep8 and unit tests

The pypy build is still failing on my local system due to a missing Python.h file. I'm not sure if this is specific to my system or not.