Fixed flake8 warnings (forgot to import sys, and forgot to remove left-over stuff after refactoring).