more pep8 compatibility and a couple bugs