PEP8 compatibility fixes
improved signal handling robustness; removed obsolete stuff; simplified things