Fixed run mode and merge function