Fix waitForEvents behavior if whenFinished===undefined