Proper exception handle for deluge client
Remove unused imports and fix reserved naming on variables