Fixed some bugs related to analyse_runs