Fixed the merge bugs