more pep8 fixes and unittest fixes