Fixes in login, logout and others