Fix event callback removal for strict mode