Formatting and other fixes suggested by flake8.