Fixed an issue where lines could be wrongfully removed