Fix logout button "sometimes not working" and similar