Fixed broken merge code