Small fixes, cleanup, and PEP 8