Fix for activity merge

Moved the merge to the right place and looped to update the activity
names