Fix errors in merging