KDE detection improved