Fix bugs after merge and pull position lists into a scope.