Fix bug in merge code.