Make last_scan_res update easier for static analyzers