Fix basic block setting in function duplication.