final fixes to run_analysis