Fixed some bugs in login form