Fix shift-delete behavior
Fix logic typo