Fix errors in renumber and append code