Fix infinite loop while renaming tmpevt (again).