Fix overflowing problem when last edit is "delete".