Fixed warnings 'W601' according to flake8.
Fixed warnings 'W391' according to flake8.