Bugfixes and Code Style

Code is now entirely (minus docstrings) PEP-8 compliant. More
bug-squashing.