Don't segfault.

1. Pass the correct desktop when checking if the focused desktop matches.
2. Don't assume that a last desktop exists.
2. Don't assume that a last monitor exists.

(sorry)