Fix patch for #7150, which was not deleting the events object properly on plain JS...