Fix logout issues