Various fixes.

First commit fixes #2294
Second commit fixes #2298, originally caused by https://github.com/linuxmint/Cinnamon/commit/91f749f7d71c308d744e5036b855799fb848d186
3rd commit fixes #2303