Fix pyflakes warnings