Fix more flake8 issues.

It turns out flake8's behaviour differs between Python 2 and Python 3
because of the changes between the two, so run it on both on Travis.