Fix various pyflakes warnings.