Fixed an issue with logout not resetting state.