Fix stylistic problems noticed by flake8