Handle correctly a logout problem. Closes #3774.

Also remove preferences button disable, we don't need that.
Merge remote-tracking branch 'ivan-github/bug/3774_handle-logout-problem' into develop