Fixed bugs found by PyLint.