Fix little problem in extension detection and fix some PyLint complaints.