Added register and fixed login.