Fix bugs in login view