Merged and fixed bugs in login.