scripts: fix bug in transfer_merge