Change signature of WaitForEvents