Fixed pep8 compatibility and added automated tests for compliance