Fixed similar bugs like https://bugs.kde.org/show_bug.cgi?id=335535.