Cleanup and revert logout functionality to not throw exception.