Finish log in/log out and improved login test