Fixed more bugs in login