Fixed two issues of login