Logout code is again asynchronous, though this implementation is still a suboptimal workaround. I'll fix it up properly later.