Remove unused os and sys imports. Minor PEP 8 fixes.