Fixed copy_analysis function