Fixed logout bug.
Revert of last commit.