correct various issues reported by pyflakes