[BUG] Fixes various bugs found in user auth.