Fix issues noted by pyflakes