Bug fixes for sign in crash