Fixed pyflakes bugs