Merged copy_reference_genome script from master