Maintain first line and last line number when needed