Adjusting wait_for_event to accomodate both singletons and arrays