Fix problems found by pyflakes