fix Pyflakes warnings (unused variables and fix "log" -> "logger")