Fixed typo.
Fixed bugs found by PyLint.