auth_check() fixes