Fixed login and added logout.