Fix issue in login/logout synchronization.