fixed: flakes and pep8 in unit tests