Fix deleting the correct lines