Refactored kdesudo while fixing a bug