pep8 and other small fixes