Fixing some test failures and PEP8 violations from prior commit