Fix extra line deletion logic.