Fixed pyflakes-undefined-name errors.