Handle correctly a logout problem. Closes #3774.

Also remove preferences button disable, we don't need that.