Fix logout, user permissions