Fix an off by one in clearing the edit window