Fixing bug where non-replaced lines don't get removed in some cases