fix numbering and references to numbered lines