[FIX] Wrong login/logout handling in the client. Added specs for that.