Fixed bug in WaitForMultipleObjects.