Fixed some git-merge bugs